summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Coca <brian.coca+git@gmail.com>2017-09-19 19:16:23 -0400
committerBrian Coca <bcoca@users.noreply.github.com>2017-09-20 16:55:36 -0400
commit43e0a0369b388e146625e1821d9d6cfb40e482dc (patch)
tree144f6df83ec4c0ca556318448839eb6c02eebd9a
parent82754c7a31676c9e69758e4040ac6a6abe017de1 (diff)
downloadansible-43e0a0369b388e146625e1821d9d6cfb40e482dc.tar.gz
fix for yaml inventory in not likeing 'none'
-rw-r--r--lib/ansible/inventory/yaml.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ansible/inventory/yaml.py b/lib/ansible/inventory/yaml.py
index 94f131364d..bda16fa877 100644
--- a/lib/ansible/inventory/yaml.py
+++ b/lib/ansible/inventory/yaml.py
@@ -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: