From 159c19d90b6ae9913ba3e92c1b65841717ebc4ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Luttringer?= Date: Thu, 27 Jun 2013 15:02:18 +0200 Subject: [PATCH] Remove failed payloads when errors occur during build --- installsystems/image/source.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/installsystems/image/source.py b/installsystems/image/source.py index 943154e..579dc18 100644 --- a/installsystems/image/source.py +++ b/installsystems/image/source.py @@ -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): -- GitLab