lookaside: Remove tempfile when hash verification fails

Without this, tempfiles just accumulate.
This commit is contained in:
Mathieu Bridon 2014-10-28 10:07:33 +01:00 committed by Pierre-Yves Chibon
parent dc0ddb5392
commit 76d83b13a0

View file

@ -188,6 +188,7 @@ def main():
tmpfd.close()
check_md5sum = m.hexdigest()
if md5sum != check_md5sum:
os.unlink(tmpfile)
send_error("MD5 check failed. Received %s instead of %s." % (check_md5sum, md5sum))
# wow, even the MD5SUM matches. make sure full path is valid now