From c71817c2e88793c9f2b99e3c9e3c7c8fbaf45962 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Sat, 30 Nov 2019 16:17:20 +0100 Subject: [PATCH] Don't fail if image dir doesn't exist during build cleanup --- build/usr/lib/python3.6/lxcbuild/imagebuilder.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/usr/lib/python3.6/lxcbuild/imagebuilder.py b/build/usr/lib/python3.6/lxcbuild/imagebuilder.py index d368adc..8d5300b 100644 --- a/build/usr/lib/python3.6/lxcbuild/imagebuilder.py +++ b/build/usr/lib/python3.6/lxcbuild/imagebuilder.py @@ -151,7 +151,10 @@ class ImageBuilder: def clean(self): lxcmgr.destroy_container(self.image.name) - shutil.rmtree(self.get_layer_path(self.image.name)) + try: + shutil.rmtree(self.get_layer_path(self.image.name)) + except FileNotFoundError: + pass def unpack_http_archive(src, dst): # Decompress an archive downloaded via http(s)