Allow leading ranges in the inventory host entries.

This commit is contained in:
Martynas Mickevicius
2013-10-03 11:41:34 +03:00
parent 6480945184
commit 44279ce34f
4 changed files with 11 additions and 3 deletions

View File

@@ -294,6 +294,12 @@ class TestInventory(unittest.TestCase):
expected_hosts=['host1A','host2A','host1B','host2B']
assert sorted(hosts) == sorted(expected_hosts)
def test_leading_range(self):
i = Inventory(os.path.join(self.test_dir, 'inventory','test_leading_range'))
hosts = i.list_hosts('test')
expected_hosts=['1.host','2.host','A.host','B.host']
assert sorted(hosts) == sorted(expected_hosts)
###################################################
### Inventory API tests

View File

@@ -0,0 +1,3 @@
[test]
[1:2].host
[A:B].host