From d9d7e413a5c11bc7cc0392ab0d44674e997c8a87 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Tue, 4 Oct 2016 14:23:57 -0400 Subject: [PATCH] fixed storing of cwd --- lib/ansible/plugins/action/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/plugins/action/__init__.py b/lib/ansible/plugins/action/__init__.py index 7b5940d2ff..1919ab492a 100644 --- a/lib/ansible/plugins/action/__init__.py +++ b/lib/ansible/plugins/action/__init__.py @@ -721,8 +721,8 @@ class ActionBase(with_metaclass(ABCMeta, object)): # Change directory to basedir of task for command execution when connection is local if self._connection.transport == 'local': - os.chdir(self._loader.get_basedir()) cwd = os.getcwd() + os.chdir(self._loader.get_basedir()) try: rc, stdout, stderr = self._connection.exec_command(cmd, in_data=in_data, sudoable=sudoable) finally: