Merge pull request #4775 from steverweber/fix-4640

dont sudo if sudo_user is the same as the connection user
This commit is contained in:
Michael DeHaan 2013-11-01 15:27:55 -07:00
commit 99687749a3

View file

@ -748,6 +748,10 @@ class Runner(object):
executable = C.DEFAULT_EXECUTABLE
sudo_user = self.sudo_user
if self.remote_user == sudo_user:
sudoable = False
rc, stdin, stdout, stderr = conn.exec_command(cmd, tmp, sudo_user, sudoable=sudoable, executable=executable)
if type(stdout) not in [ str, unicode ]: