Skip to content
This repository has been archived by the owner on Oct 1, 2022. It is now read-only.

Commit

Permalink
Merge branch 'fixing-CMS-logical-file-issue-' of https://github.com/s…
Browse files Browse the repository at this point in the history
…sl-hep/ServiceX_DID_Finder_Rucio into fixing-CMS-logical-file-issue-
  • Loading branch information
Ilija Vukotic committed Apr 7, 2022
2 parents 09a0852 + 692387c commit 0709ab6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/servicex/did_finder/rucio_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]}],
Expand All @@ -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 \
Expand All @@ -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.')

0 comments on commit 0709ab6

Please sign in to comment.