Handle exception if a file could not be deleted during clean-up of unwanted files, thus preventing a failure of wic in this case.
Signed-off-by: Andreas Reichel <[email protected]> Signed-off-by: Jan Kiszka <[email protected]> Signed-off-by: Daniel Wagner <[email protected]> --- scripts/lib/wic/plugins/imager/direct.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py index f2e6127331..d6b47ff0bb 100644 --- a/scripts/lib/wic/plugins/imager/direct.py +++ b/scripts/lib/wic/plugins/imager/direct.py @@ -541,7 +541,12 @@ class PartitionedImage(): def cleanup(self): # remove partition images for image in set(self.partimages): - os.remove(image) + try: + os.remove(image) + except IOError as e: + logger.warning( + "Could not delete file. {0}: I/O error ({1}): {2}\n".format( + image, e.errno, e.strerror)) def assemble(self): logger.debug("Installing partitions") -- 2.11.0 -- _______________________________________________ Openembedded-core mailing list [email protected] http://lists.openembedded.org/mailman/listinfo/openembedded-core
