From b9a1845d1bd283d15b0b7a6b753066700a401848 Mon Sep 17 00:00:00 2001 From: Gordon Watts Date: Tue, 5 Apr 2022 16:10:51 -0400 Subject: [PATCH] Enable parsing of DID parameters (#51) * New version of DID library that parses `get` and `files` parameters * Reshape replica-not-found errors so that they are reported via an exception at the very end. See the [ServiceX story](https://github.com/ssl-hep/ServiceX/issues/395) for more background information. --- * Bump the library * Refix the version. Duh. * Fix a 3.6 bug in a library * Typeo in version number * Bump release - last one was bogus * Lastest bug fixes * Use the new get availibility code * Fix flake8 error * Bug fix in the client library * Move to released version of library --- requirements.txt | 2 +- src/servicex/did_finder/rucio_adapter.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 0fe7ad5..9c8d85d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ rucio-clients>=1.26.1 pika==1.1.0 -servicex-did-finder-lib>=1.1a5 +servicex-did-finder-lib>=1.1 xmltodict wheel diff --git a/src/servicex/did_finder/rucio_adapter.py b/src/servicex/did_finder/rucio_adapter.py index 60ba873..eb8bd3c 100644 --- a/src/servicex/did_finder/rucio_adapter.py +++ b/src/servicex/did_finder/rucio_adapter.py @@ -120,6 +120,7 @@ def list_files_for_did(self, did): datasets = self.list_datasets_for_did(did) if not datasets: return + no_replica_files = 0 for ds in datasets: reps = self.replica_client.list_replicas( [{'scope': ds[0], 'name': ds[1]}], @@ -140,6 +141,7 @@ def list_files_for_did(self, did): # Path is either a list of replicas or a single logical name if 'url' not in f: self.logger.error(f"File {f['identity']} has no replicas.") + no_replica_files += 1 continue path = self.get_paths(f['url']) \ if not self.report_logical_files else \ @@ -154,3 +156,7 @@ def list_files_for_did(self, did): } ) yield g_files + + if no_replica_files > 0: + raise ValueError(f'Dataset {did} is missing replicas for {no_replica_files} ' + 'of its files.')