зеркало из https://github.com/mozilla/pjs.git
bug 455578: make sure upload.py always cleans up after itself. r=ted
This commit is contained in:
Родитель
53e7324549
Коммит
4a974e30aa
|
@ -162,6 +162,7 @@ def UploadFiles(user, host, path, files, verbose=False, port=None, ssh_key=None,
|
|||
if base_path is not None:
|
||||
base_path = os.path.abspath(base_path)
|
||||
remote_files = []
|
||||
try:
|
||||
for file in files:
|
||||
file = os.path.abspath(file)
|
||||
if not os.path.isfile(file):
|
||||
|
@ -178,8 +179,13 @@ def UploadFiles(user, host, path, files, verbose=False, port=None, ssh_key=None,
|
|||
print "Running post-upload command: " + post_upload_command
|
||||
file_list = '"' + '" "'.join(remote_files) + '"'
|
||||
DoSSHCommand('%s "%s" %s' % (post_upload_command, path, file_list), user, host, port=port, ssh_key=ssh_key)
|
||||
except:
|
||||
print "Encountered error while uploading"
|
||||
raise
|
||||
finally:
|
||||
if upload_to_temp_dir:
|
||||
DoSSHCommand("rm -rf %s" % path, user, host, port=port, ssh_key=ssh_key)
|
||||
DoSSHCommand("rm -rf %s" % path, user, host, port=port,
|
||||
ssh_key=ssh_key)
|
||||
if verbose:
|
||||
print "Upload complete"
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче