Skip to content
Snippets Groups Projects
Commit e128bf2d authored by Mattia Mancini's avatar Mattia Mancini
Browse files

Using bulk method

parent aeaa49d7
Branches
No related tags found
1 merge request!10Implement pruning mechanism for the utils script
Pipeline #39332 passed with warnings
...@@ -48,14 +48,10 @@ def remove_surl_locations(surls: List[str], dry_run=False) -> None: ...@@ -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 Removes SURL location if dry_run is specified it only tests
""" """
context = gfal2.creat_context() context = gfal2.creat_context()
for surl in surls:
if not dry_run: if not dry_run:
context.unlink(surls)
logger.debug("removing surl %s", surl)
logger.debug("file stats are: %s", context.stat(surl))
context.unlink(surl)
else: else:
for surl in surls:
logger.info("[dry-run] removing surl %s", surl) logger.info("[dry-run] removing surl %s", surl)
logger.info("file stats are: %s", context.stat(surl)) logger.info("file stats are: %s", context.stat(surl))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment