-
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.
Patch cms specific PFN to scope:name translation function
- Loading branch information
Hasan Ozturk
committed
Jul 4, 2024
1 parent
26e67be
commit 470dbde
Showing
3 changed files
with
22 additions
and
4 deletions.
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# | ||
# Eric Vaandering <[email protected]>, 2022 | ||
|
||
from CMSRucioPolicy.algorithms import lfn2pfn, auto_approve | ||
from CMSRucioPolicy.algorithms import lfn2pfn, auto_approve, pfn2scope_name | ||
|
||
SUPPORTED_VERSION = ["32", "33", "34"] | ||
|
||
|
@@ -17,5 +17,8 @@ def get_algorithms(): | |
}, | ||
'auto_approve': { | ||
'global': auto_approve.global_approval, | ||
}, | ||
'pfn2scope_name': { | ||
'cms': pfn2scope_name.cms_pfn2scope_name, | ||
} | ||
} |
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,15 @@ | ||
""" | ||
PFN to scope:name translation algorithm for CMS Rucio policy | ||
""" | ||
from collections.abc import Mapping | ||
|
||
def cms_pfn2scope_name(parsed_pfn: Mapping[str, str]) -> tuple[str, str]: | ||
""" | ||
TODO: Write a description | ||
""" | ||
# Ignore user scopes for now | ||
scope = "cms" | ||
name = parsed_pfn['path'] + parsed_pfn['name'] | ||
print("Inside cms function") | ||
print(f"name: {name}") | ||
return name, scope |