diff --git a/did_finder_rucio/src/rucio_did_finder/rucio_adapter.py b/did_finder_rucio/src/rucio_did_finder/rucio_adapter.py index d93a69318..cd100f8d6 100644 --- a/did_finder_rucio/src/rucio_did_finder/rucio_adapter.py +++ b/did_finder_rucio/src/rucio_did_finder/rucio_adapter.py @@ -173,7 +173,7 @@ def list_files_for_did(self, did): try: reps = self.replica_client.list_replicas( [{"scope": ds[0], "name": ds[1]}], - schemes=["root", "http", "https"], + schemes=["davs", "root", "http", "https"], metalink=True, sort="geoip", rse_expression="istape=False\\type=SPECIAL", diff --git a/transformer_sidecar/src/transformer_sidecar/transformer.py b/transformer_sidecar/src/transformer_sidecar/transformer.py index 12ce63882..cf1a36a68 100644 --- a/transformer_sidecar/src/transformer_sidecar/transformer.py +++ b/transformer_sidecar/src/transformer_sidecar/transformer.py @@ -32,6 +32,7 @@ import sys import time import timeit +import re from argparse import Namespace from hashlib import sha1, sha256 from pathlib import Path @@ -131,8 +132,11 @@ def transform_file( if convert_root_to_parquet: result_format = "root" + # Change davs to https + _file_paths = change_davs_to_https(paths) + # Prioritize the replicas - _file_paths = prioritize_replicas(paths) + _file_paths = prioritize_replicas(_file_paths) # adding cache prefix _file_paths = prepend_xcache(_file_paths) @@ -516,6 +520,21 @@ def prioritize_replicas(replicas: list[str]) -> list[str]: return root_replicas + http_replicas +def change_davs_to_https(replicas: list[str]) -> list[str]: + """ + Converts all replica URLs in the provided list that start with "davs" to use + "https" instead. + + Args: + replicas (list[str]): A list of replica URLs or paths. + + Returns: + list[str]: A list of replica URLs with "davs" replaced by "https" at the + start of each string. + """ + return [re.sub("^davs", "https", _) for _ in replicas] + + def get_process_info(): """ Get process information (just cpu, sys, iowait times right now) and