From: Aleksander Mistewicz Date: Thu, 27 Apr 2017 14:18:09 +0000 (+0200) Subject: Fix removal of files from MD5SUMS X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6a6074c8133c582af049b30ee28fbff0ae1dd7cb;p=tools%2Ftestlab%2Fmajor.git Fix removal of files from MD5SUMS Change-Id: I50c60113fcda7a1bd1fc11f188a891ef9f6a500a --- diff --git a/tsp/scripts/download_all.py b/tsp/scripts/download_all.py index a2a67a7..4bc391d 100755 --- a/tsp/scripts/download_all.py +++ b/tsp/scripts/download_all.py @@ -236,9 +236,14 @@ class Downloader(threading.Thread): else: logging.warn("Checksum FAILED\nRemoving files mentioned in md5sums file") with open(md5_path, 'r') as f: - for i in f: + for line in f: try: - os.remove(self.name + "/" + i) + filename = line.split(' ') + if len(filename) != 2: + logging.warn("Unexpected number of substrings [%d]: %s", + len(filename), line) + break + os.remove(self.name + "/" + filename[1]) except OSError as e: logging.warn("rm: %s" % e.strerror) os.remove(md5_path)