diff --git a/installsystems/image/source.py b/installsystems/image/source.py index 943154e618ca46383e3abf35d692d099fc0ef71e..579dc1897e3c2a034524c3b6365b09d846d5aded 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):