fix for yaml inventory in not likeing 'none'

This commit is contained in:
Brian Coca 2017-09-19 19:16:23 -04:00 committed by Brian Coca
parent 82754c7a31
commit 43e0a0369b

View file

@ -83,19 +83,19 @@ class InventoryParser(object):
if section in group_data and isinstance(group_data[section], string_types):
group_data[section] = { group_data[section]: None}
if 'vars' in group_data:
if group_data.get('vars', False):
for var in group_data['vars']:
if var != 'ansible_group_priority':
self.groups[group].set_variable(var, group_data['vars'][var])
else:
self.groups[group].set_priority(group_data['vars'][var])
if 'children' in group_data:
if group_data.get('children', False):
for subgroup in group_data['children']:
self._parse_groups(subgroup, group_data['children'][subgroup])
self.groups[group].add_child_group(self.groups[subgroup])
if 'hosts' in group_data:
if group_data.get('hosts', False):
for host_pattern in group_data['hosts']:
hosts = self._parse_host(host_pattern, group_data['hosts'][host_pattern])
for h in hosts: