From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id E593D3208 for ; Thu, 12 Feb 2015 02:25:32 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP; 11 Feb 2015 17:25:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,562,1418112000"; d="scan'208";a="453438704" Received: from kmsmsx153.gar.corp.intel.com ([172.21.73.88]) by FMSMGA003.fm.intel.com with ESMTP; 11 Feb 2015 17:10:50 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by KMSMSX153.gar.corp.intel.com (172.21.73.88) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 12 Feb 2015 09:25:29 +0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.197]) by shsmsx102.ccr.corp.intel.com ([169.254.2.62]) with mapi id 14.03.0195.001; Thu, 12 Feb 2015 09:25:28 +0800 From: "Liu, Yong" To: "Qiu, Michael" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH 2/2] framework/ssh: Add destination available for file copy function Thread-Index: AQHQRfX9gGaX7zV9/0qFKBT54y2iHZzsOULQ Date: Thu, 12 Feb 2015 01:25:27 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E10D7AE15@SHSMSX103.ccr.corp.intel.com> References: <1423657585-13429-1-git-send-email-michael.qiu@intel.com> In-Reply-To: <1423657585-13429-1-git-send-email-michael.qiu@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH 2/2] framework/ssh: Add destination available for file copy function X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2015 01:25:33 -0000 Applied, thanks michael. > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Michael Qiu > Sent: Wednesday, February 11, 2015 8:26 PM > To: dts@dpdk.org > Subject: [dts] [PATCH 2/2] framework/ssh: Add destination available for > file copy function >=20 > For file copy in ssh module, the destination is fixed. > This patch make it configurable. >=20 > Signed-off-by: Michael Qiu > --- > framework/ssh_connection.py | 8 ++++---- > framework/ssh_pexpect.py | 8 ++++---- > 2 files changed, 8 insertions(+), 8 deletions(-) >=20 > diff --git a/framework/ssh_connection.py b/framework/ssh_connection.py > index 25f249a..f86b3b5 100644 > --- a/framework/ssh_connection.py > +++ b/framework/ssh_connection.py > @@ -61,8 +61,8 @@ class SSHConnection(object): > def isalive(self): > return self.session.isalive() >=20 > - def copy_file_from(self, filename, password=3D''): > - self.session.copy_file_from(filename, password) > + def copy_file_from(self, src, dst =3D ".", password=3D''): > + self.session.copy_file_from(src, dst, password) >=20 > - def copy_file_to(self, filename, password=3D''): > - self.session.copy_file_to(filename, password) > + def copy_file_to(self, src, dst =3D "~/", password=3D''): > + self.session.copy_file_to(src, dst, password) > diff --git a/framework/ssh_pexpect.py b/framework/ssh_pexpect.py > index 9c353e7..8f8c982 100644 > --- a/framework/ssh_pexpect.py > +++ b/framework/ssh_pexpect.py > @@ -66,21 +66,21 @@ class SSHPexpect(object): > def isalive(self): > return self.session.isalive() >=20 > - def copy_file_from(self, filename, password=3D''): > + def copy_file_from(self, src, dst =3D ".", password=3D''): > """ > Copies a file from a remote place into local. > """ > - command =3D 'scp {0}@{1}:{2} .'.format(self.username, self.host, > filename) > + command =3D 'scp {0}@{1}:{2} {3}'.format(self.username, self.hos= t, > src, dst) > if password =3D=3D '': > self._spawn_scp(command, self.password) > else: > self._spawn_scp(command, password) >=20 > - def copy_file_to(self, filename, password=3D''): > + def copy_file_to(self, src, dst =3D "~/", password=3D''): > """ > Sends a local file to a remote place. > """ > - command =3D 'scp {0} {1}@{2}:'.format(filename, self.username, > self.host) > + command =3D 'scp {0} {1}@{2}:{3}'.format(src, self.username, > self.host, dst) > if password =3D=3D '': > self._spawn_scp(command, self.password) > else: > -- > 1.9.3