Do not procced to make a images
authorYonghee Han <onstudy@samsung.com>
Thu, 18 Oct 2018 05:01:45 +0000 (14:01 +0900)
committerYonghee Han <onstudy@samsung.com>
Thu, 31 Jan 2019 01:21:23 +0000 (10:21 +0900)
 If download_num differs from note
 Because it creates too many unnecessary images.

Change-Id: I14460f0c938ecf63870146a7bfa8cdf7aea6050c

job_imager.py

index 33071eb..d281a73 100755 (executable)
@@ -288,6 +288,19 @@ def main():
             print 'Error: TRIGGER_INFO doesn\'t contain %s'
             return 1
 
+    #TODO: If download_num differs from note, do not proceed!
+    if 'download_num' in fields:
+        try:
+            if 0 == sync_get(os.path.join(sync_dest, 'buildinfo.in'), 'tmp_download_num'):
+                H = dict(line.strip().split('=') for line in open('tmp_download_num'))
+                print H
+                if int(H['download_num']) != int(fields['download_num']):
+                    print 'DO NOT sync! download_num differs: %s, %s' \
+                          % (fields['download_num'], H['download_num'])
+                    return
+        except Exception, err:
+            print 'Error while reading note! %s' % str(err)
+
     build_id = fields["buildid"]
     name = fields['name']