mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Tracebacks are now catchable with ignore_errors and have streamlined output. Also removes 'baby-JSON' for bash modules.
This commit is contained in:
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user