mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
Allow leading ranges in the inventory host entries.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
3
test/inventory/test_leading_range
Normal file
3
test/inventory/test_leading_range
Normal file
@@ -0,0 +1,3 @@
|
||||
[test]
|
||||
[1:2].host
|
||||
[A:B].host
|
||||
Reference in New Issue
Block a user