From ea5e2d46ee21f14e88de25a843177dd5ffb6af32 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 (cherry picked from commit d9d7e413a5c11bc7cc0392ab0d44674e997c8a87) --- 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 449db1ab3c3..2d1653bcaee 100644 --- a/lib/ansible/plugins/action/__init__.py +++ b/lib/ansible/plugins/action/__init__.py @@ -737,8 +737,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: