Skip to content

Commit

Permalink
Patch cms specific PFN to scope:name translation function
Browse files Browse the repository at this point in the history
  • Loading branch information
Hasan Ozturk committed Jul 4, 2024
1 parent 26e67be commit 470dbde
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
6 changes: 3 additions & 3 deletions docker/rucio-daemons/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ RUN rmdir /etc/grid-security/certificates && ln -s /cvmfs/grid.cern.ch/etc/grid-
ADD docker/rucio-daemons/cms-entrypoint.sh /

# Cannot make patch directory unless there are patches
#RUN mkdir -p /patch
RUN mkdir -p /patch

# Patch for auto approve plugin rucio/pull/6215
#ADD https://github.com/rucio/rucio/pull/6215.patch /patch/6215.patch
# Patch for pfn to scope:name translation
ADD https://patch-diff.githubusercontent.com/raw/haozturk/rucio/pull/1.patch /patch/6817.patch

ENTRYPOINT ["/cms-entrypoint.sh"]
5 changes: 4 additions & 1 deletion src/policy/CMSRucioPolicy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand All @@ -17,5 +17,8 @@ def get_algorithms():
},
'auto_approve': {
'global': auto_approve.global_approval,
},
'pfn2scope_name': {
'cms': pfn2scope_name.cms_pfn2scope_name,
}
}
15 changes: 15 additions & 0 deletions src/policy/CMSRucioPolicy/algorithms/pfn2scope_name.py
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

0 comments on commit 470dbde

Please sign in to comment.