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 0B970A00C5; Wed, 8 Dec 2021 09:55:04 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C3F3F410E8; Wed, 8 Dec 2021 09:55:03 +0100 (CET) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by mails.dpdk.org (Postfix) with ESMTP id 12D1C406FF for ; Wed, 8 Dec 2021 09:55:03 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id C699F1376FB; Wed, 8 Dec 2021 09:55:01 +0100 (CET) X-Virus-Scanned: amavisd-new at siecit.sk Received: from lb.pantheon.sk ([127.0.0.1]) by localhost (lb.pantheon.sk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id p_XEpOXNTOrQ; Wed, 8 Dec 2021 09:55:00 +0100 (CET) Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id 6CADF1376EB; Wed, 8 Dec 2021 09:55:00 +0100 (CET) From: =?UTF-8?q?Juraj=20Linke=C5=A1?= To: lijuan.tu@intel.com, ohilyard@iol.unh.edu Cc: dts@dpdk.org, =?UTF-8?q?Juraj=20Linke=C5=A1?= Subject: [PATCH v2] framework/tester: fix pylama errors Date: Wed, 8 Dec 2021 09:54:59 +0100 Message-Id: <1638953699-8512-1-git-send-email-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1637761862-4247-1-git-send-email-juraj.linkes@pantheon.tech> References: <1637761862-4247-1-git-send-email-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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 Pylama found the following errors: framework/tester.py:247: [E] E1136 Value 'self.duts' is unsubscriptable [pylint] framework/tester.py:259: [E] E1133 Non-iterable value self.duts is used in an iterating context [pylint] framework/tester.py:348: [E] E1101 Instance of 'Exception' has no 'message' member [pylint] framework/tester.py:372: [E] E1101 Instance of 'Exception' has no 'message' member [pylint] Signed-off-by: Juraj Linkeš --- Lijuan, please add additional people to review if needed. --- framework/tester.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/tester.py b/framework/tester.py index 9dba4e4d..cb3d2015 100644 --- a/framework/tester.py +++ b/framework/tester.py @@ -85,7 +85,7 @@ class Tester(Crb): check_crb_python_version(self) self.bgProcIsRunning = False - self.duts = None + self.duts = [] self.inBg = 0 self.scapyCmds = [] self.bgCmds = [] @@ -345,7 +345,7 @@ class Tester(Crb): self.send_expect("ifconfig %s up" % itf, "# ") except Exception as e: - self.logger.error(" !!! Restore ITF: " + e.message) + self.logger.error(f" !!! Restore ITF: {e}") sleep(2) @@ -369,7 +369,7 @@ class Tester(Crb): self.enable_ipv6(itf) self.send_expect("ifconfig %s up" % itf, "# ") except Exception as e: - self.logger.error(" !!! Restore ITF: " + e.message) + self.logger.error(f" !!! Restore ITF: {e}") sleep(2) -- 2.20.1