add toggle to controle inventory parse as error (#28729)

* add toggle to controle inventory parse as error

also rearranged new inventory options into it's own ini section

* updated with inventory features

also minor fixes/consolidation on deprecated/removed modules

* tweaked settings
This commit is contained in:
Brian Coca 2017-08-28 17:17:19 -04:00 committed by GitHub
parent 862cde5e82
commit de6ba4daff
4 changed files with 56 additions and 30 deletions

View file

@ -267,9 +267,17 @@ class InventoryManager(object):
else:
if not parsed and failures:
# only if no plugin processed files should we show errors.
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 C.INVENTORY_UNPARSED_IS_FAILED:
msg = "Could not parse inventory source %s with availabel plugins:\n" % source
for fail in failures:
msg += 'Plugin %s failed: %s\n' % (fail['plugin'], to_native(fail['exc']))
if display.verbosity >= 3:
msg += "%s\n" % fail['exc'].tb
raise AnsibleParserError(msg)
else:
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))