Skip to content
Snippets Groups Projects
Commit 159c19d9 authored by Sébastien Luttringer's avatar Sébastien Luttringer
Browse files

Remove failed payloads when errors occur during build

parent aa4e15df
No related branches found
No related tags found
No related merge requests found
......@@ -313,6 +313,11 @@ class SourceImage(Image):
unlink(paydesc["link_path"])
symlink(paydesc["dest_path"], paydesc["link_path"])
except Exception as e:
# cleaning file in case of error
if exists(paydesc["dest_path"]):
unlink(paydesc["dest_path"])
if lexists(paydesc["link_path"]):
unlink(paydesc["link_path"])
raise ISError(u"Unable to create payload %s" % payload_name, e)
def create_payload_tarball(self, tar_path, data_path, compressor):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment