Tracebacks are now catchable with ignore_errors and have streamlined output. Also removes 'baby-JSON' for bash modules.

This commit is contained in:
Michael DeHaan 2014-09-11 12:26:54 -04:00
commit 26cdddaebf
9 changed files with 32 additions and 47 deletions

View file

@ -138,4 +138,10 @@ class InventoryScript(object):
except OSError, e:
raise errors.AnsibleError("problem running %s (%s)" % (' '.join(cmd), e))
(out, err) = sp.communicate()
return utils.parse_json(out)
if out.strip() == '':
return dict()
try:
return utils.parse_json(out)
except ValueError:
raise errors.AnsibleError("could not parse post variable response: %s, %s" % (cmd, out))