mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Be sure to return to the old directory if cwd is set in run_command
This commit is contained in:
parent
a348f67238
commit
a0cb974575
1 changed files with 1 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue