-
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.
Add pfn2lfn function to the policy package
- Loading branch information
Hasan Ozturk
committed
Sep 12, 2024
1 parent
46a0d28
commit e0403ea
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
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 |