From 8c988d538b6577a3c4561211c8d855209917a2ba Mon Sep 17 00:00:00 2001 From: Frederic GILLARDO Date: Wed, 15 Jan 2025 18:51:56 +0100 Subject: [PATCH 1/3] fixe rucioCatalog --- src/DIRAC/Resources/Catalog/RucioFileCatalogClient.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/DIRAC/Resources/Catalog/RucioFileCatalogClient.py b/src/DIRAC/Resources/Catalog/RucioFileCatalogClient.py index 5fa02a954d8..235a00146b3 100644 --- a/src/DIRAC/Resources/Catalog/RucioFileCatalogClient.py +++ b/src/DIRAC/Resources/Catalog/RucioFileCatalogClient.py @@ -60,6 +60,7 @@ class RucioFileCatalogClient(FileCatalogClientBase): "resolveDataset", "getLFNForPFN", "getUserDirectory", + "getFileUserMetadata", ] WRITE_METHODS = FileCatalogClientBase.WRITE_METHODS + [ @@ -78,6 +79,7 @@ class RucioFileCatalogClient(FileCatalogClientBase): "createDataset", "changePathOwner", "changePathMode", + "setMetadata", ] NO_LFN_METHODS = FileCatalogClientBase.NO_LFN_METHODS + [ @@ -703,10 +705,11 @@ def getFileUserMetadata(self, path): """Get the meta data attached to a file, but also to all its parents """ + path=next(iter(path)) resDict = {"Successful": {}, "Failed": {}} try: did = self.__getDidsFromLfn(path) - meta = [met for met in self.client.get_metadata_bulk(dids=[did], inherit=True)] + meta = next(self.client.get_metadata_bulk(dids=[did], inherit=True, plugin="ALL")) if meta["did_type"] == "FILE": # Should we also return the metadata for the directories ? resDict["Successful"][path] = meta else: @@ -763,6 +766,7 @@ def setMetadataBulk(self, pathMetadataDict): def setMetadata(self, path, metadataDict): """Add metadata to the given path""" pathMetadataDict = {} + path=next(iter(path)) pathMetadataDict[path] = metadataDict return self.setMetadataBulk(pathMetadataDict) From 532082c1ff02afef6cf9d8ffddfe17d136dc2978 Mon Sep 17 00:00:00 2001 From: Frederic GILLARDO Date: Wed, 15 Jan 2025 19:25:50 +0100 Subject: [PATCH 2/3] fixe Rucio File Catalog --- src/DIRAC/Resources/Catalog/RucioFileCatalogClient.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/DIRAC/Resources/Catalog/RucioFileCatalogClient.py b/src/DIRAC/Resources/Catalog/RucioFileCatalogClient.py index 235a00146b3..90a798312f8 100644 --- a/src/DIRAC/Resources/Catalog/RucioFileCatalogClient.py +++ b/src/DIRAC/Resources/Catalog/RucioFileCatalogClient.py @@ -717,6 +717,7 @@ def getFileUserMetadata(self, path): except DataIdentifierNotFound: resDict["Failed"][path] = "No such file or directory" except Exception as err: + breakpoint() return S_ERROR(str(err)) return S_OK(resDict) From ae5a7714dddd48fefaf456bbad880fa1f91b888d Mon Sep 17 00:00:00 2001 From: Frederic GILLARDO Date: Wed, 15 Jan 2025 19:29:12 +0100 Subject: [PATCH 3/3] remove break point --- src/DIRAC/Resources/Catalog/RucioFileCatalogClient.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/DIRAC/Resources/Catalog/RucioFileCatalogClient.py b/src/DIRAC/Resources/Catalog/RucioFileCatalogClient.py index 90a798312f8..235a00146b3 100644 --- a/src/DIRAC/Resources/Catalog/RucioFileCatalogClient.py +++ b/src/DIRAC/Resources/Catalog/RucioFileCatalogClient.py @@ -717,7 +717,6 @@ def getFileUserMetadata(self, path): except DataIdentifierNotFound: resDict["Failed"][path] = "No such file or directory" except Exception as err: - breakpoint() return S_ERROR(str(err)) return S_OK(resDict)