mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00:00
utils/ssh: Split out the sudo_cmd
template
Split out the `sudo_cmd` template to reduce duplication for SSH based connections and for use from WA to ensure the template stays in sync.
This commit is contained in:
parent
a82db5ed37
commit
5473031ab7
@ -59,6 +59,9 @@ from devlib.connection import (ConnectionBase, ParamikoBackgroundCommand, PopenB
|
||||
SSHTransferManager)
|
||||
|
||||
|
||||
DEFAULT_SSH_SUDO_COMMAND = "sudo -p ' ' -S -- sh -c {}"
|
||||
|
||||
|
||||
ssh = None
|
||||
scp = None
|
||||
sshpass = None
|
||||
@ -67,6 +70,7 @@ sshpass = None
|
||||
logger = logging.getLogger('ssh')
|
||||
gem5_logger = logging.getLogger('gem5-connection')
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def _handle_paramiko_exceptions(command=None):
|
||||
try:
|
||||
@ -286,7 +290,7 @@ class SshConnectionBase(ConnectionBase):
|
||||
keyfile=None,
|
||||
port=None,
|
||||
platform=None,
|
||||
sudo_cmd="sudo -p ' ' -S -- sh -c {}",
|
||||
sudo_cmd=DEFAULT_SSH_SUDO_COMMAND,
|
||||
strict_host_check=True,
|
||||
):
|
||||
super().__init__()
|
||||
@ -369,7 +373,7 @@ class SshConnection(SshConnectionBase):
|
||||
port=22,
|
||||
timeout=None,
|
||||
platform=None,
|
||||
sudo_cmd="sudo -p ' ' -S -- sh -c {}",
|
||||
sudo_cmd=DEFAULT_SSH_SUDO_COMMAND,
|
||||
strict_host_check=True,
|
||||
use_scp=False,
|
||||
poll_transfers=False,
|
||||
|
Loading…
x
Reference in New Issue
Block a user