summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Mistewicz <a.mistewicz@samsung.com>2016-12-29 13:32:36 (GMT)
committerAleksander Mistewicz <a.mistewicz@samsung.com>2017-03-29 10:48:09 (GMT)
commit671957ceb4fc58ace86bd0f89cbe30f4e7953e4e (patch)
tree68ef28f2121f03455040794b5e1f74478883cfa1
parenteebd60cfe0894c635af7dceccd93b67f85fc8176 (diff)
downloadmajor-671957ceb4fc58ace86bd0f89cbe30f4e7953e4e.zip
major-671957ceb4fc58ace86bd0f89cbe30f4e7953e4e.tar.gz
major-671957ceb4fc58ace86bd0f89cbe30f4e7953e4e.tar.bz2
Check if file is available before md5sums checkrefs/changes/59/108759/3
It breaks requirement: download until image will be available. Disappearing images should be covered by crawler. Change-Id: I469795c1c7b0c550f73b7e3d546da93acba65b28 Signed-off-by: Aleksander Mistewicz <a.mistewicz@samsung.com>
-rwxr-xr-xtsp/scripts/download_all.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tsp/scripts/download_all.py b/tsp/scripts/download_all.py
index 52399b9..9489ca1 100755
--- a/tsp/scripts/download_all.py
+++ b/tsp/scripts/download_all.py
@@ -184,8 +184,15 @@ class Downloader(threading.Thread):
sub_dwns.add(subprocess.Popen(["wget", "-cq", url], cwd=self.name))
for sub_dwn in sub_dwns:
sub_dwn.wait()
- if self.check_md5(md5sums):
+ r = self.session.head(md5sums)
+ if r.status_code == requests.codes.ok:
+ if self.check_md5(md5sums):
+ break
+ elif r.status_code == 404:
+ logging.debug("MD5SUMS missing: %s", md5sums)
break
+ else:
+ logging.warn("MD5SUMS error: %s", md5sums)
if self.work.is_set():
time.sleep(10)