]> git.ipfire.org Git - pbs.git/commitdiff
backend: rmtree: Ignore if path didn't exist
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 26 May 2023 16:52:51 +0000 (16:52 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 26 May 2023 16:52:51 +0000 (16:52 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/buildservice/__init__.py

index fd248bb8720acf8f19e288e10a5414b5be61fb3b..1bb79ca72b5a482f8e72994915290f91fc6c7203 100644 (file)
@@ -402,7 +402,12 @@ class Backend(object):
 
                log.debug("Removing %s..." % path)
 
-               await asyncio.to_thread(shutil.rmtree, path)
+               try:
+                       await asyncio.to_thread(shutil.rmtree, path)
+
+               # Ignore if path didn't exist in the first place
+               except FileNotFoundError:
+                       pass
 
        def tempfile(self, mode="w+b", delete=True):
                """