mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00:00
utils/ssh: Ensure the detected sshpass is used
Since we detect the sshpass tool using which(), ensure that the code uses that instead of just relying on PATH.
This commit is contained in:
parent
c39d40c6f8
commit
f30fb0b3fd
@ -1604,13 +1604,15 @@ class AndroidGem5Connection(Gem5Connection):
|
|||||||
|
|
||||||
gem5_logger.info("Android booted")
|
gem5_logger.info("Android booted")
|
||||||
|
|
||||||
|
|
||||||
def _give_password(password, command):
|
def _give_password(password, command):
|
||||||
if not sshpass:
|
if sshpass:
|
||||||
|
pass_template = "{} -p {} "
|
||||||
|
pass_string = pass_template.format(quote(sshpass), quote(password))
|
||||||
|
redacted_string = pass_template.format(quote(sshpass), quote('<redacted>'))
|
||||||
|
return (pass_string + command, redacted_string + command)
|
||||||
|
else:
|
||||||
raise HostError('Must have sshpass installed on the host in order to use password-based auth.')
|
raise HostError('Must have sshpass installed on the host in order to use password-based auth.')
|
||||||
pass_template = "sshpass -p {} "
|
|
||||||
pass_string = pass_template.format(quote(password))
|
|
||||||
redacted_string = pass_template.format(quote('<redacted>'))
|
|
||||||
return (pass_string + command, redacted_string + command)
|
|
||||||
|
|
||||||
|
|
||||||
def process_backspaces(text):
|
def process_backspaces(text):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user