From: "Zhou, JunX W" <junx.w.zhou@intel.com>
To: "Xia, YanX" <yanx.xia@intel.com>, "dts@dpdk.org" <dts@dpdk.org>
Cc: "Xia, YanX" <yanx.xia@intel.com>
Subject: Re: [dts] [PATCH V1] framework:Fix run dts on python 3.8 SyntaxWarning
Date: Fri, 11 Dec 2020 07:31:24 +0000 [thread overview]
Message-ID: <b042ca2d89574848928ad196f4bfbb49@intel.com> (raw)
In-Reply-To: <20201211071250.26875-1-yanx.xia@intel.com>
[-- Attachment #1: Type: text/plain, Size: 5167 bytes --]
Tested-by: Zhou, Jun <junx.w.zhou@intel.com>
-----Original Message-----
From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Xia Yan
Sent: Friday, December 11, 2020 3:13 PM
To: dts@dpdk.org
Cc: Xia, YanX <yanx.xia@intel.com>
Subject: [dts] [PATCH V1] framework:Fix run dts on python 3.8 SyntaxWarning
modify dut,logger,packet,project_dpdk,settings,tester and virt_resource under the framework to run dts python 3.8 SyntaxWarning
Signed-off-by: Xia Yan <yanx.xia@intel.com>
---
framework/dut.py | 2 +-
framework/logger.py | 2 +-
framework/packet.py | 4 ++--
framework/project_dpdk.py | 4 ++--
framework/settings.py | 2 +-
framework/tester.py | 2 +-
framework/virt_resource.py | 4 ++--
7 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/framework/dut.py b/framework/dut.py index dcf833b4..4c732ec9 100644
--- a/framework/dut.py
+++ b/framework/dut.py
@@ -573,7 +573,7 @@ class Dut(Crb):
"""
Setup Freebsd hugepages.
"""
- if hugepages is -1:
+ if hugepages == -1:
hugepages = 4096
num_buffers = hugepages / 1024
diff --git a/framework/logger.py b/framework/logger.py index 4600c5fc..63e1d831 100644
--- a/framework/logger.py
+++ b/framework/logger.py
@@ -465,7 +465,7 @@ class LogParser(object):
def __dict_log(self, lvl_name, msg):
tmp = {}
- if lvl_name is not '':
+ if lvl_name != '':
tmp[lvl_name] = msg
return tmp
diff --git a/framework/packet.py b/framework/packet.py index 7d974db0..1c325ff2 100644
--- a/framework/packet.py
+++ b/framework/packet.py
@@ -209,7 +209,7 @@ class scapy(object):
def strip_vlan(self, element, p_index=0):
value = None
- if self.pkts[p_index].haslayer('Dot1Q') is 0:
+ if self.pkts[p_index].haslayer('Dot1Q') == 0:
return None
if element == 'vlan':
@@ -227,7 +227,7 @@ class scapy(object):
def strip_etag(self, element, p_index=0):
value = None
- if self.pkts[p_index].haslayer('Dot1BR') is 0:
+ if self.pkts[p_index].haslayer('Dot1BR') == 0:
return None
if element == 'ECIDbase':
diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py index 259282f4..583fcd6c 100644
--- a/framework/project_dpdk.py
+++ b/framework/project_dpdk.py
@@ -308,7 +308,7 @@ class DPDKdut(Dut):
if 'i386' in cur_path:
pkg_path = cur_path
break
- assert(pkg_path is not ''), "please make sure you env have the i386 pkg-config path"
+ assert(pkg_path != ''), "please make sure you env have the i386 pkg-config path"
self.send_expect("export CFLAGS=-m32", "# ")
self.send_expect("export PKG_CONFIG_LIBDIR=%s" % pkg_path, "# ") @@ -545,7 +545,7 @@ class DPDKdut(Dut):
if 'i386' in cur_path:
pkg_path = cur_path
break
- assert(pkg_path is not ''), "please make sure you env have the i386 pkg-config path"
+ assert(pkg_path != ''), "please make sure you env have the i386 pkg-config path"
self.send_expect("export CFLAGS=-m32", "# ", alt_session=True)
self.send_expect("export PKG_CONFIG_LIBDIR=%s" % pkg_path, "# ", alt_session=True) diff --git a/framework/settings.py b/framework/settings.py index 2b6a3ce3..c5edbb7a 100644
--- a/framework/settings.py
+++ b/framework/settings.py
@@ -385,7 +385,7 @@ def accepted_nic(pci_id):
if pci_id not in list(NICS.values()):
return False
- if nic is 'any':
+ if nic == 'any':
return True
else:
diff --git a/framework/tester.py b/framework/tester.py index b2cbdb0d..ec233b8a 100644
--- a/framework/tester.py
+++ b/framework/tester.py
@@ -354,7 +354,7 @@ class Tester(Crb):
try:
for port_info in self.ports_info:
nic_type = port_info.get('type')
- if nic_type is not 'trex':
+ if nic_type != 'trex':
continue
pci_bus = port_info.get('pci')
port_inst = port_info.get('port') diff --git a/framework/virt_resource.py b/framework/virt_resource.py index 4356ee50..6ae2a28b 100644
--- a/framework/virt_resource.py
+++ b/framework/virt_resource.py
@@ -83,7 +83,7 @@ class VirtResource(object):
def __port_on_socket(self, pci, socket):
for port in self.ports_info:
if port['pci'] == pci:
- if socket is -1:
+ if socket == -1:
return True
if port['numa'] == socket:
@@ -118,7 +118,7 @@ class VirtResource(object):
def __core_on_socket(self, core, socket):
for dut_core in self.dut.cores:
if int(dut_core['thread']) == core:
- if socket is -1:
+ if socket == -1:
return True
if int(dut_core['socket']) == socket:
--
2.17.1
[-- Attachment #2: dts.log --]
[-- Type: application/octet-stream, Size: 5004 bytes --]
next prev parent reply other threads:[~2020-12-11 7:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-11 7:12 Xia Yan
2020-12-11 7:31 ` Zhou, JunX W [this message]
2020-12-15 7:13 ` Tu, Lijuan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b042ca2d89574848928ad196f4bfbb49@intel.com \
--to=junx.w.zhou@intel.com \
--cc=dts@dpdk.org \
--cc=yanx.xia@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).