From 27d37d8bdf38eb7361b3db94494666b7228834e4 Mon Sep 17 00:00:00 2001 From: Yonghee Han Date: Thu, 18 Oct 2018 14:01:45 +0900 Subject: [PATCH] Do not procced to make a images If download_num differs from note Because it creates too many unnecessary images. Change-Id: I14460f0c938ecf63870146a7bfa8cdf7aea6050c --- job_imager.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/job_imager.py b/job_imager.py index 33071eb..d281a73 100755 --- a/job_imager.py +++ b/job_imager.py @@ -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'] -- 2.7.4