changeset 522:a084456960c9 prerelease

updated heavy uploader
author Giulio Moro <giuliomoro@yahoo.it>
date Thu, 23 Jun 2016 03:46:56 +0100
parents 545087a05bc8
children 42f6af3a5f1d
files scripts/hvresources/uploader.py
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/hvresources/uploader.py	Thu Jun 23 00:15:51 2016 +0100
+++ b/scripts/hvresources/uploader.py	Thu Jun 23 03:46:56 2016 +0100
@@ -7,7 +7,6 @@
 import requests
 import shutil
 import stat
-import sys
 import tempfile
 import time
 import urlparse
@@ -150,7 +149,7 @@
     except Exception as e:
         print "{0}Error:{1} {2}".format(Colours.red, Colours.end, e)
         shutil.rmtree(temp_dir) # clean up the temporary directory
-        sys.exit(1)
+        return
 
     post_data["name"] = args.name
 
@@ -272,7 +271,7 @@
         for i,x in enumerate(r_json["errors"]):
             print "{3}) {0}Error:{1} {2}".format(
                 Colours.red, Colours.end, x["detail"], i+1)
-        sys.exit(2)
+        return
 
     # retrieve all requested files
     for i,g in enumerate(args.gen):
@@ -315,8 +314,7 @@
 
     print "Job URL:", reply_json["data"]["links"]["self"]
     print "Total request time: {0}ms".format(int(1000.0*(time.time()-tick)))
-    print "Heavy version:", reply_json["meta"]["version"]
-    sys.exit(0) # success!
+    print "Heavy release:", reply_json.get("meta",{}).get("release", "default")
 
 def __get_file_url_for_generator(json_api, g):
     """Returns the file link for a specific generator.