Skip to content
Merged
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
6 changes: 5 additions & 1 deletion src/DIRAC/Resources/Catalog/RucioFileCatalogClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,9 @@ def setMetadataBulk(self, pathMetadataDict):
"""Add metadata for the given paths"""
resDict = {"Successful": {}, "Failed": {}}
dids = []
paths = []
for path, metadataDict in pathMetadataDict.items():
paths.append(path)
try:
did = self.__getDidsFromLfn(path)
did["meta"] = metadataDict
Expand All @@ -760,8 +762,10 @@ def setMetadataBulk(self, pathMetadataDict):
return S_ERROR(str(err))
try:
self.client.set_dids_metadata_bulk(dids=dids, recursive=False)
resDict["Successful"] = {path: True for path in paths}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering, I am not familiar with Rucio: can't we have partially successful/failed operation? Seems like it can only be all successful or failed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bulk method, so either everything succeeds or fails

except Exception as err:
return S_ERROR(str(err))
resDict["Failed"] = {path: str(err) for path in paths}
return S_ERROR(resDict)
return S_OK(resDict)

@checkCatalogArguments
Expand Down
Loading