mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-27 15:11:23 -07:00
Make sure the cwd exists in run_command before trying to use it
This commit is contained in:
parent
751510141f
commit
60a7f57300
1 changed files with 3 additions and 1 deletions
|
@ -1074,8 +1074,10 @@ class AnsibleModule(object):
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if cwd:
|
# make sure we're in the right working directory
|
||||||
|
if cwd and os.path.isdir(cwd):
|
||||||
os.chdir(cwd)
|
os.chdir(cwd)
|
||||||
|
|
||||||
cmd = subprocess.Popen(args, **kwargs)
|
cmd = subprocess.Popen(args, **kwargs)
|
||||||
|
|
||||||
if data:
|
if data:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue