diff --git a/devlib/utils/ssh.py b/devlib/utils/ssh.py index f07b67b..58b7659 100644 --- a/devlib/utils/ssh.py +++ b/devlib/utils/ssh.py @@ -1604,13 +1604,15 @@ class AndroidGem5Connection(Gem5Connection): gem5_logger.info("Android booted") + 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('')) + return (pass_string + command, redacted_string + command) + else: 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('')) - return (pass_string + command, redacted_string + command) def process_backspaces(text):