From b11c288f11bb04cb48c50088279546085db8bc27 Mon Sep 17 00:00:00 2001 From: Paul Vinciguerra Date: Tue, 30 Apr 2019 20:57:04 -0700 Subject: vpp_config: correct usage of 'is' for equality tests. Change-Id: I30b1cdb2930560d7c40c1bde098fd21f16a17683 Signed-off-by: Paul Vinciguerra --- extras/vpp_config/vpplib/VPPUtil.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'extras/vpp_config/vpplib/VPPUtil.py') diff --git a/extras/vpp_config/vpplib/VPPUtil.py b/extras/vpp_config/vpplib/VPPUtil.py index 2cbaa2d0aaf..5ed46f2452e 100644 --- a/extras/vpp_config/vpplib/VPPUtil.py +++ b/extras/vpp_config/vpplib/VPPUtil.py @@ -402,18 +402,18 @@ class VPPUtil(object): return interfaces lines = stdout.split('\n') - if len(lines[0]) is not 0: + if len(lines[0]) != 0: if lines[0].split(' ')[0] == 'FileNotFoundError': return interfaces name = '' for line in lines: - if len(line) is 0: + if len(line) == 0: continue # If the first character is not whitespace # create a new interface - if len(re.findall(r'\s', line[0])) is 0: + if len(re.findall(r'\s', line[0])) == 0: spl = line.split() name = spl[0] if name == 'local0': @@ -444,17 +444,17 @@ class VPPUtil(object): return interfaces lines = stdout.split('\n') - if len(lines[0]) is not 0: + if len(lines[0]) != 0: if lines[0].split(' ')[0] == 'FileNotFoundError': return interfaces for line in lines: - if len(line) is 0: + if len(line) == 0: continue # If the first character is not whitespace # create a new interface - if len(re.findall(r'\s', line[0])) is 0: + if len(re.findall(r'\s', line[0])) == 0: spl = line.split() name = spl[0] interfaces[name] = {} @@ -731,12 +731,12 @@ class VPPUtil(object): return version lines = stdout.split('\n') - if len(lines[0]) is not 0: + if len(lines[0]) != 0: if lines[0].split(' ')[0] == 'FileNotFoundError': return version for line in lines: - if len(line) is 0: + if len(line) == 0: continue dct = line.split(':') version[dct[0]] = dct[1].lstrip(' ') -- cgit 1.2.3-korg