be more robust when removing download artifacts and remove bogus raise statement

This commit is contained in:
Benjamin Peterson 2013-11-13 12:02:50 -05:00
parent 825b127d47
commit d328ab765b

View File

@ -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):