Inventory and varmanager updates (#32054)

* better parsing erros

* fix inventorydata serialization

* dicts fix
This commit is contained in:
Brian Coca 2017-10-30 14:55:13 -04:00 committed by GitHub
parent e70c0afc5e
commit c3564096cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 4 deletions

View file

@ -263,7 +263,10 @@ class InventoryManager(object):
display.vvv('Parsed %s inventory source with %s plugin' % (to_native(source), plugin_name))
break
except AnsibleParserError as e:
display.debug('%s did not meet %s requirements' % (to_native(source), plugin_name))
display.debug('%s was not parsable by %s' % (to_native(source), plugin_name))
failures.append({'src': source, 'plugin': plugin_name, 'exc': e})
except Exception as e:
display.debug('%s failed to parse %s' % (plugin_name, to_native(source)))
failures.append({'src': source, 'plugin': plugin_name, 'exc': e})
else:
display.debug('%s did not meet %s requirements' % (to_native(source), plugin_name))
@ -281,7 +284,6 @@ class InventoryManager(object):
for fail in failures:
display.warning('\n* Failed to parse %s with %s plugin: %s' % (to_native(fail['src']), fail['plugin'], to_native(fail['exc'])))
display.vvv(fail['exc'].tb)
if not parsed:
display.warning("Unable to parse %s as an inventory source" % to_native(source))