Fine tune sanity (#53544)

* modify regex to use implicit charsets this should solve issues in py3 and unicode names
* fix issue with subgroups in yaml inventory
* clarify deprecation message
* separated per name warning from deprecation
* move noise to verbosity, simplify warnings
* fix docs to reflect actual 'good' practice
* change toggle to choice list to give users more options
This commit is contained in:
Brian Coca 2019-03-11 15:12:14 -04:00 committed by GitHub
parent 86ba4f3e46
commit 9b67219096
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 40 additions and 22 deletions

View file

@ -153,7 +153,7 @@ class InventoryModule(BaseFileInventoryPlugin):
self.inventory.set_variable(group, var, group_data[key][var])
elif key == 'children':
for subgroup in group_data[key]:
self._parse_group(subgroup, group_data[key][subgroup])
subgroup = self._parse_group(subgroup, group_data[key][subgroup])
self.inventory.add_child(group, subgroup)
elif key == 'hosts':
@ -166,6 +166,8 @@ class InventoryModule(BaseFileInventoryPlugin):
else:
self.display.warning("Skipping '%s' as this is not a valid group definition" % group)
return group
def _parse_host(self, host_pattern):
'''
Each host key can be a pattern, try to process it and add variables as needed