Skip to content

Commit

Permalink
Merge pull request #1021 from valsdav/patch-2
Browse files Browse the repository at this point in the history
feat: allowing unmatched files in rucio utils
  • Loading branch information
lgray authored Feb 8, 2024
2 parents 40c6db2 + 7ce1caa commit 5d1a2b1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/coffea/dataset_tools/rucio_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def get_dataset_files_replicas(
blocklist_sites=None,
regex_sites=None,
mode="full",
partial_allowed=False,
client=None,
scope="cms",
):
Expand Down Expand Up @@ -150,6 +151,7 @@ def get_dataset_files_replicas(
regex_sites: list
mode: str, default "full"
client: rucio Client, optional
partial_allowed: bool, default False
scope: rucio scope, "cms"
Returns
Expand Down Expand Up @@ -195,7 +197,7 @@ def get_dataset_files_replicas(
outsite.append(site)
found = True

if not found:
if not found and not partial_allowed:
raise Exception(
f"No SITE available in the allowlist for file {filedata['name']}"
)
Expand All @@ -206,7 +208,7 @@ def get_dataset_files_replicas(
filter(lambda key: key not in blocklist_sites, possible_sites)
)

if len(possible_sites) == 0:
if len(possible_sites) == 0 and not partial_allowed:
raise Exception(f"No SITE available for file {filedata['name']}")

# now check for regex
Expand Down Expand Up @@ -246,7 +248,7 @@ def get_dataset_files_replicas(
outsite.append(site)
found = True

if not found:
if not found and not partial_allowed:
raise Exception(f"No SITE available for file {filedata['name']}")
else:
if mode == "full":
Expand Down

0 comments on commit 5d1a2b1

Please sign in to comment.