Workaround download_all missing md5sum 26/121926/1
authorAleksander Mistewicz <a.mistewicz@samsung.com>
Wed, 18 Jan 2017 13:00:20 +0000 (14:00 +0100)
committerAleksander Mistewicz <a.mistewicz@samsung.com>
Wed, 29 Mar 2017 10:48:09 +0000 (12:48 +0200)
Change-Id: Iac3704084632658c5d0990fed43f3993a4b06a82

tsp/scripts/download_all.py

index 9489ca1..a2a67a7 100755 (executable)
@@ -184,17 +184,20 @@ class Downloader(threading.Thread):
                 sub_dwns.add(subprocess.Popen(["wget", "-cq", url], cwd=self.name))
             for sub_dwn in sub_dwns:
                 sub_dwn.wait()
-            r = self.session.head(md5sums)
-            if r.status_code == requests.codes.ok:
-                if self.check_md5(md5sums):
+            if 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
-            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)
             else:
-                logging.warn("MD5SUMS error: %s", md5sums)
-            if self.work.is_set():
-                time.sleep(10)
+                break
 
         logging.info("Stop downloader: %s" % self.name)