From e128bf2dfd9ff62e3e9109b624c87cfeb527e613 Mon Sep 17 00:00:00 2001 From: mancini <mancini@astron.nl> Date: Thu, 10 Nov 2022 16:58:14 +0100 Subject: [PATCH] Using bulk method --- atdb/prune.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/atdb/prune.py b/atdb/prune.py index fa2e15a..9cedfb0 100644 --- a/atdb/prune.py +++ b/atdb/prune.py @@ -48,14 +48,10 @@ def remove_surl_locations(surls: List[str], dry_run=False) -> None: Removes SURL location if dry_run is specified it only tests """ context = gfal2.creat_context() - - for surl in surls: - if not dry_run: - - logger.debug("removing surl %s", surl) - logger.debug("file stats are: %s", context.stat(surl)) - context.unlink(surl) - else: + if not dry_run: + context.unlink(surls) + else: + for surl in surls: logger.info("[dry-run] removing surl %s", surl) logger.info("file stats are: %s", context.stat(surl)) -- GitLab