mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
dont sudo if sudo_user is the same as the active user
This commit is contained in:
@@ -736,6 +736,10 @@ class Runner(object):
|
|||||||
executable = C.DEFAULT_EXECUTABLE
|
executable = C.DEFAULT_EXECUTABLE
|
||||||
|
|
||||||
sudo_user = self.sudo_user
|
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)
|
rc, stdin, stdout, stderr = conn.exec_command(cmd, tmp, sudo_user, sudoable=sudoable, executable=executable)
|
||||||
|
|
||||||
if type(stdout) not in [ str, unicode ]:
|
if type(stdout) not in [ str, unicode ]:
|
||||||
|
|||||||
Reference in New Issue
Block a user