From bbf320fd22161614e425757a264952edf61493a4 Mon Sep 17 00:00:00 2001 From: Dan Koch Date: Wed, 12 Mar 2014 14:59:50 -0400 Subject: [PATCH] Work around for cwd stat problems with run_command and sudo This fixes issue #6443 --- lib/ansible/module_utils/basic.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index 2d45987314..3eace12eeb 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -1074,6 +1074,8 @@ class AnsibleModule(object): try: + if cwd: + os.chdir(cwd) cmd = subprocess.Popen(args, **kwargs) if data: