From patchwork Mon Dec 6 12:18:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Juraj_Linke=C5=A1?= X-Patchwork-Id: 104931 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C622DA034F; Mon, 6 Dec 2021 13:18:55 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 36D8642785; Mon, 6 Dec 2021 13:18:50 +0100 (CET) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by mails.dpdk.org (Postfix) with ESMTP id A468142743 for ; Mon, 6 Dec 2021 13:18:38 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id 19B5113429D; Mon, 6 Dec 2021 13:18:38 +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 oUgB89_4SPxT; Mon, 6 Dec 2021 13:18:36 +0100 (CET) Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id 1B554130F7E; Mon, 6 Dec 2021 13:18:35 +0100 (CET) From: =?utf-8?q?Juraj_Linke=C5=A1?= To: lijuan.tu@intel.com, ohilyard@iol.unh.edu Cc: dts@dpdk.org, =?utf-8?q?Juraj_Linke=C5=A1?= Subject: [PATCH v1] ics/net_device: fix pylama errors Date: Mon, 6 Dec 2021 13:18:34 +0100 Message-Id: <1638793115-2374-1-git-send-email-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 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: nics/net_device.py:104: [E] E0213 Method should have "self" as first argument [pylint] nics/net_device.py:114: [E] E1102 func is not callable [pylint] nics/net_device.py:206: [E] E1101 Instance of 'NetDevice' has no 'current_driver' member [pylint] nics/net_device.py:297: [E] E1101 Instance of 'NetDevice' has no 'current_driver' member [pylint] nics/net_device.py:309: [E] E1101 Instance of 'NetDevice' has no 'current_driver' member [pylint] nics/net_device.py:321: [E] E1101 Instance of 'NetDevice' has no 'current_driver' member [pylint] nics/net_device.py:401: [E] E1101 Instance of 'NetDevice' has no 'current_driver' member [pylint] nics/net_device.py:441: [E] E0602 Undefined variable 'bus_id' [pylint] nics/net_device.py:461: [E] E1101 Instance of 'NetDevice' has no 'current_driver' member [pylint] nics/net_device.py:490: [E] E1101 Instance of 'NetDevice' has no 'current_driver' member [pylint] nics/net_device.py:516: [E] E1101 Instance of 'NetDevice' has no 'current_driver' member [pylint] nics/net_device.py:519: [E] E0102 method already defined line 510 [pylint] nics/net_device.py:525: [E] E1101 Instance of 'NetDevice' has no 'current_driver' member [pylint] nics/net_device.py:622: [E] E1101 Instance of 'NetDevice' has no 'current_driver' member [pylint] nics/net_device.py:696: [E] E1101 Instance of 'NetDevice' has no 'current_driver' member [pylint] Signed-off-by: Juraj Linkeš --- Lijuan, please add additional people to review if needed. --- Lijuan, please add additional people to review if needed. --- Lijuan, please add additional people to review if needed. --- nics/net_device.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/nics/net_device.py b/nics/net_device.py index 96f31327..e7c6b770 100644 --- a/nics/net_device.py +++ b/nics/net_device.py @@ -73,6 +73,7 @@ class NetDevice(object): self.driver_version = '' self.firmware = '' self.pkg = None + self.current_driver = None def stop(self): pass @@ -101,6 +102,7 @@ class NetDevice(object): """ return True + @staticmethod def nic_has_driver(func): """ Check if the NIC has a driver. @@ -438,7 +440,7 @@ class NetDevice(object): 'get_ipv4_addr_freebsd_%s' % generic_driver) - return get_ipv4_addr_freebsd(intf, bus_id, devfun_id) + return get_ipv4_addr_freebsd(intf) def get_ipv4_addr_freebsd_generic(self, intf): """ @@ -515,15 +517,6 @@ class NetDevice(object): self, 'get_ipv6_addr_%s' % self.__get_os_type()) return get_ipv6_addr(self.intf_name, self.current_driver) - @nic_has_driver - def get_ipv6_addr(self): - """ - Get ipv6 address of specified pci device. - """ - get_ipv6_addr = getattr( - self, 'get_ipv6_addr_%s' % self.__get_os_type()) - return get_ipv6_addr(self.intf_name, self.current_driver) - def get_ipv6_addr_linux(self, intf, driver): """ Get ipv6 address of specified pci device on linux.