Skip to content

Commit 13b30fe

Browse files
authored
Merge pull request #848 from misanjumn/fix-syntax-warning
Fix Syntax warnings on running ./op-test
2 parents 40328e6 + cc2b685 commit 13b30fe

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

common/OpTestHMC.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ def get_ioslots_assigned_to_lpar(self, lpar_profile=None):
381381
f" --filter 'lpar_names={self.lpar_name},"
382382
f"profile_names={lpar_profile}' -F io_slots")
383383
log.info(f"assigned_io_slots:{assigned_io_slots}")
384-
return [] if assigned_io_slots is "none" \
384+
return [] if assigned_io_slots == "none" \
385385
else assigned_io_slots[0].replace('"', "").split(",")
386386

387387
def get_lpar_name_for_ioslot(self, ioslot):

common/OpTestInstallUtil.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def wait_for_network(self):
9090
return True
9191
except CommandFailed as cf:
9292
log.debug("wait_for_network CommandFailed={}".format(cf))
93-
if cf.exitcode is 1:
93+
if cf.exitcode == 1:
9494
time.sleep(5)
9595
retry = retry - 1
9696
pass
@@ -118,7 +118,7 @@ def ping_network(self):
118118
if retry == 1:
119119
log.debug("ping_network raise cf={}".format(cf))
120120
raise cf
121-
if cf.exitcode is 1:
121+
if cf.exitcode == 1:
122122
time.sleep(5)
123123
retry = retry - 1
124124
log.debug(
@@ -217,7 +217,7 @@ def get_server_ip(self):
217217
break
218218
except CommandFailed as cf:
219219
log.debug("get_server_ip CommandFailed cf={}".format(cf))
220-
if cf.exitcode is 1:
220+
if cf.exitcode == 1:
221221
time.sleep(1)
222222
retry = retry - 1
223223
pass

testcases/OpTestFastReboot.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def runTest(self):
118118
"/proc/device-tree/ibm,opal/fast-reboot: {}"
119119
.format(fast_reboot_state[:-1]))
120120
except CommandFailed as cf:
121-
if cf.exitcode is not 1:
121+
if cf.exitcode != 1:
122122
raise cf
123123

124124
cpu = ''.join(c.run_command(

testcases/OpTestHMIHandling.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def disable_cpu_idle_states(self):
213213
states = self.cv_HOST.host_run_command(
214214
"find /sys/devices/system/cpu/cpu*/cpuidle/state* -type d | cut -d'/' -f8 | sort -u | sed -e 's/^state//'", console=1)
215215
for state in states:
216-
if state is "0":
216+
if state == "0":
217217
try:
218218
self.cv_HOST.host_run_command(
219219
"cpupower idle-set -e 0", console=1)

testcases/OpalMsglog.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def runTest(self):
127127
self.assertTrue(len(log_entries) == 0,
128128
"Warnings/Errors in OPAL log:\n%s" % msg)
129129
except CommandFailed as cf:
130-
if cf.exitcode is 1 and len(cf.output) is 0:
130+
if cf.exitcode == 1 and len(cf.output) == 0:
131131
# We have no warnings/errors!
132132
pass
133133
else:

0 commit comments

Comments
 (0)