From d328ab765beefa2d8a4e2692343c5886a19c1ba1 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Wed, 13 Nov 2013 12:02:50 -0500 Subject: [PATCH] be more robust when removing download artifacts and remove bogus raise statement --- src/etc/snapshot.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/etc/snapshot.py b/src/etc/snapshot.py index e7057defd77..99193d905f8 100644 --- a/src/etc/snapshot.py +++ b/src/etc/snapshot.py @@ -148,8 +148,11 @@ def get_url_to_file(u,f): returncode = subprocess.call(["wget", "-O", tmpf, u]) if returncode != 0: - os.unlink(tmpf) - raise + try: + os.unlink(tmpf) + except OSError as e: + pass + raise Exception("failed to fetch url") os.rename(tmpf, f) def snap_filename_hash_part(snap):