Only use cwd in run_command kwargs if the directory exists

This commit is contained in:
James Cammarata 2014-03-12 15:59:24 -05:00
parent 81b4ebbe1d
commit 303e085f8b

View file

@ -1069,7 +1069,7 @@ class AnsibleModule(object):
if path_prefix:
kwargs['env'] = env
if cwd:
if cwd and os.path.isdir(cwd):
kwargs['cwd'] = cwd