diff --git a/atdb/prune.py b/atdb/prune.py index fa2e15af8cdc870e561d6f938528a18cacd6ac23..9cedfb0beaeedd354c18944f5bc874df1b7c1d6f 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))