Do not set download_num in post release process 94/100494/1
authorhyokeun <hyokeun.jeon@samsung.com>
Mon, 28 Nov 2016 09:07:11 +0000 (18:07 +0900)
committerhyokeun <hyokeun.jeon@samsung.com>
Mon, 28 Nov 2016 09:07:11 +0000 (18:07 +0900)
Change-Id: Ia6c9a4bed82a153fad5c1b6a5f3022e1d43a4764

job_imager.py

index c415cfa..f7d3319 100755 (executable)
@@ -218,7 +218,7 @@ def main():
     fields = trigger_info(os.getenv('TRIGGER_INFO'))
 
     # Check if we've got required fields in TRIGGER_INFO
-    for field in ('kickstart', 'name', 'buildid', 'repo_path', 'download_num'):
+    for field in ('kickstart', 'name', 'buildid', 'repo_path'):
         if field not in fields:
             print 'Error: TRIGGER_INFO doesn\'t contain %s'
             return 1
@@ -241,9 +241,10 @@ def main():
             "name": fields['name'],
             "project": fields.get('project', ''),
             "status": "failed",
-            "url": url,
-            "download_num": int(fields['download_num'])
+            "url": url
             }
+    if "download_num" in fields:
+        data["download_num"] = int(fields['download_num'])
     trigger_next("POST-IMAGE-CREATION", data)
 
     ksf = os.path.join(outdir, '%s.ks' % name)
@@ -323,9 +324,10 @@ def main():
             "name": fields['name'],
             "project": fields.get('project', ''),
             "status": status,
-            "url": url,
-            "download_num": int(fields['download_num'])
+            "url": url
             }
+    if "download_num" in fields:
+        data["download_num"] = int(fields['download_num'])
 
     trigger_next("POST-IMAGE-CREATION", data)