Commit 461a4e78 by Matthew Williams

raise error if executable host file execution fails

parent 5764ccdb
...@@ -160,6 +160,9 @@ class Runner(object): ...@@ -160,6 +160,9 @@ class Runner(object):
cmd.extend(['--extra-vars', extra_vars]) cmd.extend(['--extra-vars', extra_vars])
cmd = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=False) cmd = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=False)
out, err = cmd.communicate() out, err = cmd.communicate()
rc = cmd.returncode
if rc:
raise errors.AnsibleError("%s: %s" % (host_list, err))
try: try:
groups = utils.json_loads(out) groups = utils.json_loads(out)
except: except:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment