mirror of
https://github.com/ceph/ceph
synced 2025-03-29 23:09:47 +00:00
Merge pull request #47898 from adk3798/no-sudo-true
mgr/cephadm: don't use "sudo" in commands if user is root Reviewed-by: John Mulligan <jmulligan@redhat.com> Reviewed-by: Redouane Kachach <rkachach@redhat.com>
This commit is contained in:
commit
ecd2170bfd
@ -140,7 +140,7 @@ class SSHManager:
|
||||
cmd = sudo_prefix + " ".join(quote(x) for x in cmd)
|
||||
logger.debug(f'Running command: {cmd}')
|
||||
try:
|
||||
r = await conn.run('sudo true', check=True, timeout=5)
|
||||
r = await conn.run(f'{sudo_prefix}true', check=True, timeout=5)
|
||||
r = await conn.run(cmd, input=stdin)
|
||||
# handle these Exceptions otherwise you might get a weird error like TypeError: __init__() missing 1 required positional argument: 'reason' (due to the asyncssh error interacting with raise_if_exception)
|
||||
except (asyncssh.ChannelOpenError, asyncssh.ProcessError, Exception) as e:
|
||||
|
Loading…
Reference in New Issue
Block a user