From f46b65d7ba96128177a10e40f8513ad8c2bfff92 Mon Sep 17 00:00:00 2001 From: Radu Carpa Date: Fri, 19 Jan 2024 15:08:02 +0100 Subject: [PATCH] a --- lib/rucio/transfertool/bittorrent.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/rucio/transfertool/bittorrent.py b/lib/rucio/transfertool/bittorrent.py index 377e96fceb..e775801b54 100644 --- a/lib/rucio/transfertool/bittorrent.py +++ b/lib/rucio/transfertool/bittorrent.py @@ -27,8 +27,8 @@ from .bittorrent_driver import BittorrentDriver if TYPE_CHECKING: + from rucio.core.request import DirectTransfer from rucio.core.rse import RseData - from rucio.core import transfer as transfer_core DRIVER_NAME_RSE_ATTRIBUTE = 'bittorrent_driver' DRIVER_CLASSES_BY_NAME: dict[str, Type[BittorrentDriver]] = {} @@ -90,9 +90,9 @@ def _get_torrent_meta(scope: "types.InternalScope", name: str) -> tuple[bytes, b @classmethod def submission_builder_for_path( cls: "Type[BittorrentTransfertool]", - transfer_path: "list[transfer_core.DirectTransferDefinitions]", + transfer_path: "list[DirectTransfer]", logger: types.LoggerFunction = logging.log - ) -> "tuple[list[transfer_core.DirectTransferDefinitions], Optional[TransferToolBuilder]]": + ) -> "tuple[list[DirectTransfer], Optional[TransferToolBuilder]]": hop = transfer_path[0] if hop.rws.byte_count == 0: logger(logging.INFO, f"Bittorrent cannot transfer fully empty torrents. Skipping {hop}") @@ -115,7 +115,7 @@ def submission_builder_for_path( return [hop], TransferToolBuilder(cls, external_host='Bittorrent Transfertool') - def group_into_submit_jobs(self, transfer_paths: "Sequence[list[transfer_core.DirectTransferDefinitions]]") -> dict[str, Any]: + def group_into_submit_jobs(self, transfer_paths: "Sequence[list[DirectTransfer]]") -> dict[str, Any]: return [{'transfers': transfer_path, 'job_params': {}} for transfer_path in transfer_paths] @staticmethod @@ -127,7 +127,7 @@ def _connect_without_tracker(torrent_id: str, peers_drivers: Sequence[Bittorrent for driver in peers_drivers: driver.add_peers(torrent_id=torrent_id, peers=peer_addr) - def submit(self, transfers: "Sequence[transfer_core.DirectTransferDefinitions]", job_params: dict[str, str], timeout: Optional[int] = None) -> str: + def submit(self, transfers: "Sequence[DirectTransfer]", job_params: dict[str, str], timeout: Optional[int] = None) -> str: [transfer] = transfers rws = transfer.rws