mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-06-29 23:49:09 +00:00
Fix hostname expansion bug in inventory parser
This commit is contained in:
parent
23f2a7fc7e
commit
7fbb7e079a
3 changed files with 32 additions and 20 deletions
|
|
@ -150,6 +150,17 @@ class TestInventory(unittest.TestCase):
|
|||
print expected
|
||||
assert vars == expected
|
||||
|
||||
def test_complex_group_names(self):
|
||||
inventory = self.complex_inventory()
|
||||
tests = {
|
||||
'host1': [ 'role1' ],
|
||||
'host2': [ 'role1', 'role2' ],
|
||||
'host3': [ 'role2' ]
|
||||
}
|
||||
for host, roles in tests.iteritems():
|
||||
group_names = inventory.get_variables(host)['group_names']
|
||||
assert sorted(group_names) == sorted(roles)
|
||||
|
||||
def test_complex_exclude(self):
|
||||
inventory = self.complex_inventory()
|
||||
hosts = inventory.list_hosts("nc:florida:!triangle:!orlando")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue