Commit a0cb9745 by James Cammarata

Be sure to return to the old directory if cwd is set in run_command

parent a348f672
......@@ -1096,6 +1096,7 @@ class AnsibleModule(object):
self.fail_json(rc=e.errno, msg=str(e), cmd=clean_args)
except:
self.fail_json(rc=257, msg=traceback.format_exc(), cmd=clean_args)
if rc != 0 and check_rc:
msg = err.rstrip()
self.fail_json(cmd=clean_args, rc=rc, stdout=out, stderr=err, msg=msg)
......
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