Commit 12e5babd authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Handle 'FileNotFoundError' exception.

parent 2e565f06
Loading
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -100,10 +100,14 @@ class RetrieveCleaner(TaskExecutor):
                        except Exception:
                            self.logger.exception(f"FATAL: unable to update the 'async_trans' flag for the VOSpace node '{vospacePath}'.")
                            return False
                        try:
                            if os.path.isfile(destPath):
                                os.remove(destPath)
                            else:
                                shutil.rmtree(destPath)
                        except FileNotFoundError:
                            self.logger.exception(f"Cannot find '{destPath}', skip...")
                        # check for empty dirs and remove them
                        basePath = self.storageRetrievePath.replace("{username}", self.username)
                        for root, dirs, files in os.walk(basePath, topdown = False):
                            for dir in dirs: