Commit 80df6e41 by James Cammarata

Only use cwd in run_command kwargs if the directory exists

parent a401f957
...@@ -1044,7 +1044,7 @@ class AnsibleModule(object): ...@@ -1044,7 +1044,7 @@ class AnsibleModule(object):
if path_prefix: if path_prefix:
kwargs['env'] = env kwargs['env'] = env
if cwd: if cwd and os.path.isdir(cwd):
kwargs['cwd'] = cwd kwargs['cwd'] = cwd
......
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