From ef69d23715b6222b5b16f5f152713fced4cc5090 Mon Sep 17 00:00:00 2001 From: jeromew Date: Wed, 22 Jan 2014 14:04:39 +0000 Subject: [PATCH] Bug: chmod should be called only if the tmp dir was created in the first place --- lib/ansible/runner/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index b5138bf150..93bd212660 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -328,7 +328,7 @@ class Runner(object): environment_string = self._compute_environment_string(inject) - if (self.sudo or self.su) and (self.sudo_user != 'root' or self.su_user != 'root'): + if tmp.find("tmp") != -1 and (self.sudo or self.su) and (self.sudo_user != 'root' or self.su_user != 'root'): # deal with possible umask issues once sudo'ed to other user cmd_chmod = "chmod a+r %s" % remote_module_path self._low_level_exec_command(conn, cmd_chmod, tmp, sudoable=False)