bug 468124 - upload.py should let UPLOAD_PORT and POST_UPLOAD_CMD actually be optional. r=bsmedberg
authorTed Mielczarek <ted.mielczarek@gmail.com>
Wed, 10 Dec 2008 10:26:50 -0500
changeset 22680 26413234cbfa76eda82e6ce0172f51dd3532a88c
parent 22679 53a4f376bb71ac77881405136ffa1e79f854e932
child 22681 5ef605914426a0f5ed7d3353f4481a028bcfe880
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs468124
milestone1.9.2a1pre
bug 468124 - upload.py should let UPLOAD_PORT and POST_UPLOAD_CMD actually be optional. r=bsmedberg
build/upload.py
--- a/build/upload.py
+++ b/build/upload.py
@@ -165,22 +165,25 @@ def UploadFiles(user, host, path, files,
         DoSSHCommand('%s "%s" %s' % (post_upload_command, path, file_list), user, host, port=port, ssh_key=ssh_key)
     if verbose:
         print "Upload complete"
 
 if __name__ == '__main__':
     host = RequireEnvironmentVariable('UPLOAD_HOST')
     user = RequireEnvironmentVariable('UPLOAD_USER')
     path = RequireEnvironmentVariable('UPLOAD_PATH')
-    port = int(OptionalEnvironmentVariable('UPLOAD_PORT'))
+    port = OptionalEnvironmentVariable('UPLOAD_PORT')
+    if port is not None:
+        port = int(port)
     key = OptionalEnvironmentVariable('UPLOAD_SSH_KEY')
     post_upload_command = OptionalEnvironmentVariable('POST_UPLOAD_CMD')
     if sys.platform == 'win32':
         path = FixupMsysPath(path)
-        post_upload_command = FixupMsysPath(post_upload_command)
+        if post_upload_command is not None:
+            post_upload_command = FixupMsysPath(post_upload_command)
 
     parser = OptionParser(usage="usage: %prog [options] <files>")
     parser.add_option("-b", "--base-path",
                       action="store", dest="base_path",
                       help="Preserve file paths relative to this path when uploading. If unset, all files will be uploaded directly to UPLOAD_PATH.")
     (options, args) = parser.parse_args()
     if len(args) < 1:
         print "You must specify at least one file to upload"