raise error if executable host file execution fails
This commit is contained in:
parent
5764ccdb0e
commit
461a4e78c2
1 changed files with 3 additions and 0 deletions
|
@ -160,6 +160,9 @@ class Runner(object):
|
|||
cmd.extend(['--extra-vars', extra_vars])
|
||||
cmd = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=False)
|
||||
out, err = cmd.communicate()
|
||||
rc = cmd.returncode
|
||||
if rc:
|
||||
raise errors.AnsibleError("%s: %s" % (host_list, err))
|
||||
try:
|
||||
groups = utils.json_loads(out)
|
||||
except:
|
||||
|
|
Loading…
Reference in a new issue