From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 836DEA04B1; Wed, 26 Aug 2020 04:04:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 419BBAAB7; Wed, 26 Aug 2020 04:04:48 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 80A58255 for ; Wed, 26 Aug 2020 04:04:46 +0200 (CEST) IronPort-SDR: Ls2Yip0pOyKqqTUU0DEYcvCxOvp1oJgY+61bnBsf1qMsr86KlM4/mWdJ4MFA0gOWz0MLynyMEP SSbMeQOnusAQ== X-IronPort-AV: E=McAfee;i="6000,8403,9724"; a="220484520" X-IronPort-AV: E=Sophos;i="5.76,354,1592895600"; d="scan'208";a="220484520" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2020 19:04:45 -0700 IronPort-SDR: kdo9v4MpVkhOKStrcZKiDnCzQl8IMOkYljGwLciQSzg5JrIzK5fNaHJGGHr6K8fcAbd/Wq0kYQ ORHwU8jUx3TQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,354,1592895600"; d="scan'208";a="312746923" Received: from unknown (HELO localhost.localdomain) ([10.240.183.52]) by orsmga002.jf.intel.com with ESMTP; 25 Aug 2020 19:04:43 -0700 From: Xiao Qimai To: dts@dpdk.org Cc: Xiao Qimai Date: Wed, 26 Aug 2020 01:53:19 +0000 Message-Id: <20200826015319.106866-1-qimaix.xiao@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dts] [PATCH V1]framework/ssh_connection: fix output might be int 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: , Errors-To: dts-bounces@dpdk.org Sender: "dts" *. when verify is True in send_expect, the output might be type int. Signed-off-by: Xiao Qimai --- framework/ssh_connection.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/framework/ssh_connection.py b/framework/ssh_connection.py index e096a9e..c9886b2 100644 --- a/framework/ssh_connection.py +++ b/framework/ssh_connection.py @@ -62,7 +62,8 @@ class SSHConnection(object): def send_expect(self, cmds, expected, timeout=15, verify=False): self.logger.info(cmds) out = self.session.send_expect(cmds, expected, timeout, verify) - self.logger.debug(out.replace(cmds, '')) + if isinstance(out, str): + self.logger.debug(out.replace(cmds, '')) if type(self.history) is list: self.history.append({"command": cmds, "name": self.name, "output": out}) return out -- 2.25.1