Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions DataManagementSystem/Client/DataManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,13 @@ def putAndRegister(self, lfn, fileName, diracSE, guid=None, path=None,
errStr = "Supplied file does not exist."
log.debug(errStr, fileName)
return S_ERROR(errStr)
# check if a catalog enforces a non standard path
if not path:
pfn = self.fileCatalog.getPfnFromLfn(lfn, diracSE)
if pfn['OK']:
path = pfn['Value'] if pfn['Value'] else None
else:
path = None
# If the path is not provided then use the LFN path
if not path:
path = os.path.dirname(lfn)
Expand Down
16 changes: 15 additions & 1 deletion Resources/Catalog/FileCatalogClientBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class FileCatalogClientBase(Client):
"""

# Default mandatory methods having all-allowing implementation in the base class
READ_METHODS = ['hasAccess', 'exists', 'getPathPermissions']
READ_METHODS = ['hasAccess', 'exists', 'getPathPermissions', 'getPfnFromLfn']

# List of methods that can be complemented in the derived classes
WRITE_METHODS = []
Expand Down Expand Up @@ -115,3 +115,17 @@ def getPathPermissions(self, lfns):
"""
return S_OK({'Failed': {},
'Successful': dict.fromkeys(lfns, {'Write': True, "Read": True})})

def getPfnFromLfn(self, lfn, se):
"""
A default method to return an SE specific pfn which is non standard.
This method returns S_OK(None) to maintain a default DataManager.putAndRegister behaviour.

:param lfn: logical file name
:type lfn: str
:param se: Storage Element name
:type se: str
:return: S_OK(None)
:rtype: dict
"""
return S_OK('')
Loading