Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/105145/?format=api
http://patches.dpdk.org/api/patches/105145/?format=api", "web_url": "http://patches.dpdk.org/project/dts/patch/1639582121-26177-1-git-send-email-juraj.linkes@pantheon.tech/", "project": { "id": 3, "url": "http://patches.dpdk.org/api/projects/3/?format=api", "name": "DTS", "link_name": "dts", "list_id": "dts.dpdk.org", "list_email": "dts@dpdk.org", "web_url": "", "scm_url": "git://dpdk.org/tools/dts", "webscm_url": "http://git.dpdk.org/tools/dts/", "list_archive_url": "https://inbox.dpdk.org/dts", "list_archive_url_format": "https://inbox.dpdk.org/dts/{}", "commit_url_format": "" }, "msgid": "<1639582121-26177-1-git-send-email-juraj.linkes@pantheon.tech>", "list_archive_url": "https://inbox.dpdk.org/dts/1639582121-26177-1-git-send-email-juraj.linkes@pantheon.tech", "date": "2021-12-15T15:28:41", "name": "[v2] nics/net_device: fix pylama errors", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "ad358876a0ae3b9589e6a08b90fafc1caece82b8", "submitter": { "id": 1626, "url": "http://patches.dpdk.org/api/people/1626/?format=api", "name": "Juraj Linkeš", "email": "juraj.linkes@pantheon.tech" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dts/patch/1639582121-26177-1-git-send-email-juraj.linkes@pantheon.tech/mbox/", "series": [ { "id": 20947, "url": "http://patches.dpdk.org/api/series/20947/?format=api", "web_url": "http://patches.dpdk.org/project/dts/list/?series=20947", "date": "2021-12-15T15:28:41", "name": "[v2] nics/net_device: fix pylama errors", "version": 2, "mbox": "http://patches.dpdk.org/series/20947/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/105145/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/105145/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dts-bounces@dpdk.org>", "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])\n\tby inbox.dpdk.org (Postfix) with ESMTP id B914FA00C3;\n\tWed, 15 Dec 2021 16:28:45 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 7E23D40688;\n\tWed, 15 Dec 2021 16:28:45 +0100 (CET)", "from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20])\n by mails.dpdk.org (Postfix) with ESMTP id 20EFB40041\n for <dts@dpdk.org>; Wed, 15 Dec 2021 16:28:44 +0100 (CET)", "from localhost (localhost [127.0.0.1])\n by lb.pantheon.sk (Postfix) with ESMTP id 362D516BC06;\n Wed, 15 Dec 2021 16:28:43 +0100 (CET)", "from lb.pantheon.sk ([127.0.0.1])\n by localhost (lb.pantheon.sk [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id pMxF0i2HJs26; Wed, 15 Dec 2021 16:28:41 +0100 (CET)", "from service-node1.lab.pantheon.local (unknown [46.229.239.141])\n by lb.pantheon.sk (Postfix) with ESMTP id 7A5A316BC03;\n Wed, 15 Dec 2021 16:28:41 +0100 (CET)" ], "X-Virus-Scanned": "amavisd-new at siecit.sk", "From": "=?utf-8?q?Juraj_Linke=C5=A1?= <juraj.linkes@pantheon.tech>", "To": "lijuan.tu@intel.com,\n\tohilyard@iol.unh.edu,\n\tjunx.dong@intel.com", "Cc": "dts@dpdk.org, =?utf-8?q?Juraj_Linke=C5=A1?= <juraj.linkes@pantheon.tech>", "Subject": "[PATCH v2] nics/net_device: fix pylama errors", "Date": "Wed, 15 Dec 2021 16:28:41 +0100", "Message-Id": "<1639582121-26177-1-git-send-email-juraj.linkes@pantheon.tech>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1638793115-2374-2-git-send-email-juraj.linkes@pantheon.tech>", "References": "<1638793115-2374-2-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 <dts.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dts>,\n <mailto:dts-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dts/>", "List-Post": "<mailto:dts@dpdk.org>", "List-Help": "<mailto:dts-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dts>,\n <mailto:dts-request@dpdk.org?subject=subscribe>", "Errors-To": "dts-bounces@dpdk.org" }, "content": "Pylama found the following errors:\nnics/net_device.py:104: [E] E0213 Method should have \"self\" as first argument [pylint]\nnics/net_device.py:114: [E] E1102 func is not callable [pylint]\n- moved the decorator outside class definition, which is the standard\nway to define decorators\nnics/net_device.py:206: [E] E1101 Instance of 'NetDevice' has no 'current_driver' member [pylint]\nnics/net_device.py:297: [E] E1101 Instance of 'NetDevice' has no 'current_driver' member [pylint]\nnics/net_device.py:309: [E] E1101 Instance of 'NetDevice' has no 'current_driver' member [pylint]\nnics/net_device.py:321: [E] E1101 Instance of 'NetDevice' has no 'current_driver' member [pylint]\nnics/net_device.py:401: [E] E1101 Instance of 'NetDevice' has no 'current_driver' member [pylint]\nnics/net_device.py:441: [E] E0602 Undefined variable 'bus_id' [pylint]\nnics/net_device.py:461: [E] E1101 Instance of 'NetDevice' has no 'current_driver' member [pylint]\nnics/net_device.py:490: [E] E1101 Instance of 'NetDevice' has no 'current_driver' member [pylint]\nnics/net_device.py:516: [E] E1101 Instance of 'NetDevice' has no 'current_driver' member [pylint]\nnics/net_device.py:519: [E] E0102 method already defined line 510 [pylint]\nnics/net_device.py:525: [E] E1101 Instance of 'NetDevice' has no 'current_driver' member [pylint]\nnics/net_device.py:622: [E] E1101 Instance of 'NetDevice' has no 'current_driver' member [pylint]\nnics/net_device.py:696: [E] E1101 Instance of 'NetDevice' has no 'current_driver' member [pylint]\n\nSigned-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>\n---\nLijuan, please add additional people to review if needed.\n---\n nics/net_device.py | 43 +++++++++++++++++++------------------------\n 1 file changed, 19 insertions(+), 24 deletions(-)", "diff": "diff --git a/nics/net_device.py b/nics/net_device.py\nindex 96f31327..19e239e4 100644\n--- a/nics/net_device.py\n+++ b/nics/net_device.py\n@@ -45,6 +45,22 @@ NICS_LIST = [] # global list for save nic objects\n MIN_MTU = 68\n \n \n+def nic_has_driver(func):\n+ \"\"\"\n+ Check if the NIC has a driver.\n+ \"\"\"\n+\n+ @wraps(func)\n+ def wrapper(*args, **kwargs):\n+ nic_instance = args[0]\n+ nic_instance.current_driver = nic_instance.get_nic_driver()\n+ if not nic_instance.current_driver:\n+ return ''\n+ return func(*args, **kwargs)\n+\n+ return wrapper\n+\n+\n class NetDevice(object):\n \n \"\"\"\n@@ -73,6 +89,7 @@ class NetDevice(object):\n self.driver_version = ''\n self.firmware = ''\n self.pkg = None\n+ self.current_driver = None\n \n def stop(self):\n pass\n@@ -101,19 +118,6 @@ class NetDevice(object):\n \"\"\"\n return True\n \n- def nic_has_driver(func):\n- \"\"\"\n- Check if the NIC has a driver.\n- \"\"\"\n- @wraps(func)\n- def wrapper(*args, **kwargs):\n- nic_instance = args[0]\n- nic_instance.current_driver = nic_instance.get_nic_driver()\n- if not nic_instance.current_driver:\n- return ''\n- return func(*args, **kwargs)\n- return wrapper\n-\n def get_nic_driver(self):\n \"\"\"\n Get the NIC driver.\n@@ -273,7 +277,7 @@ class NetDevice(object):\n \"\"\"\n Get the interface name by the default way on freebsd.\n \"\"\"\n- pci_str = \"%s:%s:%s\" % (domain_id, bus_id, devfun_id) \n+ pci_str = \"%s:%s:%s\" % (domain_id, bus_id, devfun_id)\n out = self.__send_expect(\"pciconf -l\", \"# \")\n rexp = r\"(\\w*)@pci0:%s\" % pci_str\n pattern = re.compile(rexp)\n@@ -438,7 +442,7 @@ class NetDevice(object):\n 'get_ipv4_addr_freebsd_%s' %\n generic_driver)\n \n- return get_ipv4_addr_freebsd(intf, bus_id, devfun_id)\n+ return get_ipv4_addr_freebsd(intf)\n \n def get_ipv4_addr_freebsd_generic(self, intf):\n \"\"\"\n@@ -515,15 +519,6 @@ class NetDevice(object):\n self, 'get_ipv6_addr_%s' % self.__get_os_type())\n return get_ipv6_addr(self.intf_name, self.current_driver)\n \n- @nic_has_driver\n- def get_ipv6_addr(self):\n- \"\"\"\n- Get ipv6 address of specified pci device.\n- \"\"\"\n- get_ipv6_addr = getattr(\n- self, 'get_ipv6_addr_%s' % self.__get_os_type())\n- return get_ipv6_addr(self.intf_name, self.current_driver)\n-\n def get_ipv6_addr_linux(self, intf, driver):\n \"\"\"\n Get ipv6 address of specified pci device on linux.\n", "prefixes": [ "v2" ] }{ "id": 105145, "url": "