mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 21:30:22 -07:00
Tracebacks are now catchable with ignore_errors and have streamlined output. Also removes 'baby-JSON' for bash modules.
This commit is contained in:
parent
6c6a0f068e
commit
26cdddaebf
9 changed files with 32 additions and 47 deletions
|
@ -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))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue