diff options
author | Bert Van Vreckem <bert.vanvreckem@gmail.com> | 2015-12-08 12:55:09 +0100 |
---|---|---|
committer | Bert Van Vreckem <bert.vanvreckem@gmail.com> | 2015-12-08 13:10:25 +0100 |
commit | 9556bcb9c2c21f1d3ee793a85e86c4bb899f6550 (patch) | |
tree | 21546a6384e3fe68ed8e546d974b9c2de6980a25 | |
parent | 15dcabe01231d43788c05152c80eaec41bcb6dad (diff) | |
download | ansible-modules-core-9556bcb9c2c21f1d3ee793a85e86c4bb899f6550.tar.gz |
Also show stdout when validation fails. This fixes #2498
-rw-r--r-- | files/copy.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/files/copy.py b/files/copy.py index 5dd1e993..1e187306 100644 --- a/files/copy.py +++ b/files/copy.py @@ -279,7 +279,7 @@ def main(): # os.path.exists() can return false in some # circumstances where the directory does not have # the execute bit for the current user set, in - # which case the stat() call will raise an OSError + # which case the stat() call will raise an OSError os.stat(os.path.dirname(dest)) except OSError, e: if "permission denied" in str(e).lower(): @@ -308,7 +308,7 @@ def main(): module.fail_json(msg="validate must contain %%s: %s" % (validate)) (rc,out,err) = module.run_command(validate % src) if rc != 0: - module.fail_json(msg="failed to validate: rc:%s error:%s" % (rc,err)) + module.fail_json(msg="failed to validate", exit_status=rc, stdout=out, stderr=err) if remote_src: _, tmpdest = tempfile.mkstemp(dir=os.path.dirname(dest)) shutil.copy2(src, tmpdest) |