dont sudo if sudo_user is the same as the active user
This commit is contained in:
parent
d21a0287a2
commit
5bd52796ec
1 changed files with 4 additions and 0 deletions
|
@ -736,6 +736,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 ]:
|
||||
|
|
Loading…
Reference in a new issue