-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #845 from haozturk/replica-recoverer-config
Add pfn2lfn function to the policy package (PR against `rucio_35` branch)
- Loading branch information
Showing
2 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# | ||
# Eric Vaandering <[email protected]>, 2022 | ||
|
||
from CMSRucioPolicy.algorithms import lfn2pfn, auto_approve | ||
from CMSRucioPolicy.algorithms import lfn2pfn, auto_approve, pfn2lfn | ||
|
||
SUPPORTED_VERSION = ["32", "33", "34", "35"] | ||
|
||
|
@@ -17,5 +17,8 @@ def get_algorithms(): | |
}, | ||
'auto_approve': { | ||
'global': auto_approve.global_approval, | ||
}, | ||
'pfn2lfn': { | ||
'cms_pfn2lfn': pfn2lfn.cms_pfn2lfn, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
""" | ||
PFN to scope:name translation algorithm for CMS Rucio policy | ||
""" | ||
from collections.abc import Mapping | ||
|
||
def cms_pfn2lfn(parsed_pfn: Mapping[str, str]) -> tuple[str, str]: | ||
""" | ||
This function converts a PFN into scope:name pair. | ||
It ignores user scopes and sets all scopes to cms. | ||
""" | ||
# Ignore user scopes for now | ||
scope = "cms" | ||
name = parsed_pfn['path'] + parsed_pfn['name'] | ||
return name, scope |