Strip .prod.global.gc.ca from hostnames
All checks were successful
Build and Release / Build Windows Exe (push) Successful in 11s
All checks were successful
Build and Release / Build Windows Exe (push) Successful in 11s
This commit is contained in:
@@ -55,5 +55,12 @@ class TestInventoryKeys(unittest.TestCase):
|
||||
self.assertIn("good_name", hosts)
|
||||
self.assertNotIn("bad_name", hosts)
|
||||
|
||||
def test_suffix_stripping(self):
|
||||
from wif2ansible.parsers import clean_hostname
|
||||
self.assertEqual(clean_hostname("server.prod.global.gc.ca"), "server")
|
||||
self.assertEqual(clean_hostname("server.PROD.GLOBAL.GC.CA"), "server")
|
||||
self.assertEqual(clean_hostname("nosuffix"), "nosuffix")
|
||||
self.assertEqual(clean_hostname("other.suffix.com"), "other.suffix.com")
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user