fixed storing of cwd

(cherry picked from commit d9d7e413a5)
This commit is contained in:
Brian Coca 2016-10-04 14:23:57 -04:00
parent e72d1e995f
commit ea5e2d46ee

View file

@ -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: