Add tests for new advanced inventory features (groups of groups, group variables) in the default INI format file.

This commit is contained in:
Michael DeHaan 2012-05-06 18:01:11 -04:00
commit 157d21b1c3
4 changed files with 94 additions and 10 deletions

View file

@ -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

View file

@ -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)