mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 22:33:25 +00:00
Add tests for new advanced inventory features (groups of groups, group variables) in the default INI format file.
This commit is contained in:
@@ -57,6 +57,6 @@ class Host(object):
|
||||
results.update(self.vars)
|
||||
results['inventory_hostname'] = self.name
|
||||
groups = self.get_groups()
|
||||
results['group_names'] = [ g.name for g in groups if g.name != 'all']
|
||||
results['group_names'] = sorted([ g.name for g in groups if g.name != 'all'])
|
||||
return results
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ class Inventory(object):
|
||||
results = utils.parse_json(out)
|
||||
results['inventory_hostname'] = hostname
|
||||
groups = [ g.name for g in host.get_groups() if g.name != 'all' ]
|
||||
results['group_names'] = groups
|
||||
results['group_names'] = sorted(groups)
|
||||
return results
|
||||
|
||||
host = self.get_host(hostname)
|
||||
|
||||
Reference in New Issue
Block a user