From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 296AA4557F; Fri, 6 Sep 2024 15:27:35 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 41C3442F7E; Fri, 6 Sep 2024 15:27:07 +0200 (CEST) Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by mails.dpdk.org (Postfix) with ESMTP id BFF2142F57 for ; Fri, 6 Sep 2024 15:27:04 +0200 (CEST) Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-53653682246so2331078e87.1 for ; Fri, 06 Sep 2024 06:27:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1725629224; x=1726234024; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=STC3vMJpcsDuEOZuwSl+7opC0GIohy+kDS7vphHn3Ro=; b=iIc4NXgWzoNHpgNWCFi72ueOVPXsUunZGEJ8YvZ1yjTx8V0X6DdyypphtkNjFOnzhM RQQF8LPCmGOU69bN4gKDO6KsZZhMKkl5P4sVWR0fvXEHpfmC/QVEUWqsleBRdFZGh1FV kcZKZDjkhRd4a0aX+dxicPvwiMe94oBW8mAm5ldusEvi0xzBW/8h2thzryTCFzwJCbba 6yRtuzytvKt9xRs2J5+i6xnDa1RtnfkG2RGk58ertJo66UPt8CpxaA9CckA2danoVGBy Fc7GFbvcCI+/Y72wPwPIaZaLXJs4pFVRWgwGVYybfD+d6jvF/W6lcGmZGc72pZcigvlz beFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725629224; x=1726234024; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=STC3vMJpcsDuEOZuwSl+7opC0GIohy+kDS7vphHn3Ro=; b=tqhydsi3D8VUfC7UfPMNQ7b2X55Pbu8vS/lrF0p9KSdNSEvxqLDtnKKqvT7GVZuKiK EI0er8S8ZbPO+ID+1qECFIKxyDMMvWZH/GrY8KNejoDhr6g3W4t7XEJu5xSQjsnzG6Pc wMrXMFeCA7AsFR1XzTcmCdI9QdrnHOmZ/tMdSnCsKVfYhSqBGXSZ4NFGARsk32TGKKXl dU9XKT0dt9sRqMX1YUtuW+Q5Fs4pFkT/xUWZQbwc8EZLWpCh7LmuFq6aCBZg/hNJ7GZ1 avm3tvDGC2dvEazDWDusGWVNwsUBuYNBKAe715iqkVUGxudDL4m3A731VGsin2ynFY06 wnug== X-Gm-Message-State: AOJu0YwJEYeR7vS9c7ErU343yAt9E1ARJjuNZnp1NqcmkT2y/qrvTWrR FD0yd539sFKNSYQOVuBCtAofNykiFgKr6NkJ/4Wd5hnhP81+rEc0Ad3kFjmk/jE= X-Google-Smtp-Source: AGHT+IFMs1t0nslICAAW9/G7Xhld8wW2R4OrmUPwV2KQU2rPYnmo87U6cyrXO5V4XWVu9ucCsGQb7Q== X-Received: by 2002:a05:6512:2348:b0:52e:74d5:89ae with SMTP id 2adb3069b0e04-536587ef299mr1591080e87.39.1725629224063; Fri, 06 Sep 2024 06:27:04 -0700 (PDT) Received: from jlinkes-PT-Latitude-5530.. ([84.245.121.62]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8a7c504701sm168943566b.25.2024.09.06.06.27.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2024 06:27:03 -0700 (PDT) From: =?UTF-8?q?Juraj=20Linke=C5=A1?= To: thomas@monjalon.net, Honnappa.Nagarahalli@arm.com, paul.szczepanek@arm.com, Luca.Vizzarro@arm.com, alex.chapman@arm.com, probb@iol.unh.edu, jspewock@iol.unh.edu, npratte@iol.unh.edu, dmarx@iol.unh.edu Cc: dev@dpdk.org, =?UTF-8?q?Tom=C3=A1=C5=A1=20=C4=8Eurovec?= Subject: [RFC PATCH v1 04/12] dts: improve path handling for local and remote paths Date: Fri, 6 Sep 2024 15:26:48 +0200 Message-ID: <20240906132656.21729-5-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240906132656.21729-1-juraj.linkes@pantheon.tech> References: <20240906132656.21729-1-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Tomáš Ďurovec Update remote session to clearly differentiate between local and remote paths. Local paths now accept OS-aware path objects, while remote paths handle OS-agnostic paths. Signed-off-by: Tomáš Ďurovec --- dts/framework/remote_session/remote_session.py | 6 +++--- dts/framework/remote_session/ssh_session.py | 6 +++--- dts/framework/testbed_model/os_session.py | 6 +++--- dts/framework/testbed_model/posix_session.py | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dts/framework/remote_session/remote_session.py b/dts/framework/remote_session/remote_session.py index 6ca8593c90..ce311e70b6 100644 --- a/dts/framework/remote_session/remote_session.py +++ b/dts/framework/remote_session/remote_session.py @@ -12,7 +12,7 @@ from abc import ABC, abstractmethod from dataclasses import InitVar, dataclass, field -from pathlib import PurePath +from pathlib import Path, PurePath from framework.config import NodeConfiguration from framework.exception import RemoteCommandExecutionError @@ -199,7 +199,7 @@ def is_alive(self) -> bool: def copy_from( self, source_file: str | PurePath, - destination_dir: str | PurePath, + destination_dir: str | Path, ) -> None: """Copy a file from the remote Node to the local filesystem. @@ -215,7 +215,7 @@ def copy_from( @abstractmethod def copy_to( self, - source_file: str | PurePath, + source_file: str | Path, destination_dir: str | PurePath, ) -> None: """Copy a file from local filesystem to the remote Node. diff --git a/dts/framework/remote_session/ssh_session.py b/dts/framework/remote_session/ssh_session.py index a756bfecef..88a000912e 100644 --- a/dts/framework/remote_session/ssh_session.py +++ b/dts/framework/remote_session/ssh_session.py @@ -5,7 +5,7 @@ import socket import traceback -from pathlib import PurePath +from pathlib import Path, PurePath from fabric import Connection # type: ignore[import-untyped] from invoke.exceptions import ( # type: ignore[import-untyped] @@ -106,14 +106,14 @@ def is_alive(self) -> bool: def copy_from( self, source_file: str | PurePath, - destination_dir: str | PurePath, + destination_dir: str | Path, ) -> None: """Overrides :meth:`~.remote_session.RemoteSession.copy_from`.""" self.session.get(str(source_file), str(destination_dir)) def copy_to( self, - source_file: str | PurePath, + source_file: str | Path, destination_dir: str | PurePath, ) -> None: """Overrides :meth:`~.remote_session.RemoteSession.copy_to`.""" diff --git a/dts/framework/testbed_model/os_session.py b/dts/framework/testbed_model/os_session.py index 8928a47d6f..d24f44df10 100644 --- a/dts/framework/testbed_model/os_session.py +++ b/dts/framework/testbed_model/os_session.py @@ -25,7 +25,7 @@ from abc import ABC, abstractmethod from collections.abc import Iterable from ipaddress import IPv4Interface, IPv6Interface -from pathlib import PurePath +from pathlib import Path, PurePath from typing import Union from framework.config import Architecture, NodeConfiguration, NodeInfo @@ -181,7 +181,7 @@ def join_remote_path(self, *args: str | PurePath) -> PurePath: def copy_from( self, source_file: str | PurePath, - destination_dir: str | PurePath, + destination_dir: str | Path, ) -> None: """Copy a file from the remote node to the local filesystem. @@ -197,7 +197,7 @@ def copy_from( @abstractmethod def copy_to( self, - source_file: str | PurePath, + source_file: str | Path, destination_dir: str | PurePath, ) -> None: """Copy a file from local filesystem to the remote node. diff --git a/dts/framework/testbed_model/posix_session.py b/dts/framework/testbed_model/posix_session.py index 7f0b1f2036..0d8c5f91a6 100644 --- a/dts/framework/testbed_model/posix_session.py +++ b/dts/framework/testbed_model/posix_session.py @@ -13,7 +13,7 @@ import re from collections.abc import Iterable -from pathlib import PurePath, PurePosixPath +from pathlib import Path, PurePath, PurePosixPath from framework.config import Architecture, NodeInfo from framework.exception import DPDKBuildError, RemoteCommandExecutionError @@ -88,14 +88,14 @@ def join_remote_path(self, *args: str | PurePath) -> PurePosixPath: def copy_from( self, source_file: str | PurePath, - destination_dir: str | PurePath, + destination_dir: str | Path, ) -> None: """Overrides :meth:`~.os_session.OSSession.copy_from`.""" self.remote_session.copy_from(source_file, destination_dir) def copy_to( self, - source_file: str | PurePath, + source_file: str | Path, destination_dir: str | PurePath, ) -> None: """Overrides :meth:`~.os_session.OSSession.copy_to`.""" -- 2.43.0