Bug 1147271 - Add ssh option to prevent hanging on password prompt in upload.py r=mshal
MozReview-Commit-ID: Lmg5SAtLuE3
--- a/build/upload.py
+++ b/build/upload.py
@@ -85,16 +85,18 @@ def AppendOptionalArgsToSSHCommandline(c
commandline arguments to the list cmdline if the values are not None."""
if port is not None:
cmdline.append("-P%d" % port)
if ssh_key is not None:
# Don't interpret ~ paths - ssh can handle that on its own
if not ssh_key.startswith('~'):
ssh_key = WindowsPathToMsysPath(ssh_key)
cmdline.extend(["-o", "IdentityFile=%s" % ssh_key])
+ # In case of an issue here we don't want to hang on a password prompt.
+ cmdline.extend(["-o", "BatchMode=yes"])
def DoSSHCommand(command, user, host, port=None, ssh_key=None):
"""Execute command on user@host using ssh. Optionally use
port and ssh_key, if provided."""
cmdline = ["ssh"]
AppendOptionalArgsToSSHCommandline(cmdline, port, ssh_key)
cmdline.extend(["%s@%s" % (user, host), command])