Bug 1307482 - Log uploading when it actually happens; r=ted

In preparation of using a thread pool to call DoSCPFile().

MozReview-Commit-ID: Ab2gk8UTQWK

--HG--
extra : rebase_source : b1c97953f5b0be91bb16eac19ca6862e715ce7d4
This commit is contained in:
Gregory Szorc 2016-10-04 08:46:46 -07:00
parent 505c98b5da
commit 2abd0effdb

View File

@ -110,9 +110,12 @@ def DoSSHCommand(command, user, host, port=None, ssh_key=None):
raise Exception("Command %s returned non-zero exit code" % cmdline)
def DoSCPFile(file, remote_path, user, host, port=None, ssh_key=None):
def DoSCPFile(file, remote_path, user, host, port=None, ssh_key=None,
log=False):
"""Upload file to user@host:remote_path using scp. Optionally use
port and ssh_key, if provided."""
if log:
print 'Uploading %s' % file
cmdline = ["scp"]
AppendOptionalArgsToSSHCommandline(cmdline, port, ssh_key)
cmdline.extend([WindowsPathToMsysPath(file),
@ -248,9 +251,8 @@ def UploadFiles(user, host, path, files, verbose=False, port=None, ssh_key=None,
for file in files:
remote_path = get_remote_path(file)
if verbose:
print "Uploading " + file
DoSCPFile(file, remote_path, user, host, port=port, ssh_key=ssh_key)
DoSCPFile(file, remote_path, user, host, port=port, ssh_key=ssh_key,
log=verbose)
remote_files.append(remote_path + '/' + os.path.basename(file))
if post_upload_command is not None:
if verbose: