Skip to content

Commit

Permalink
Merge pull request #848 from misanjumn/fix-syntax-warning
Browse files Browse the repository at this point in the history
Fix Syntax warnings on running ./op-test
  • Loading branch information
abdhaleegit authored Jun 6, 2024
2 parents 40328e6 + cc2b685 commit 13b30fe
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion common/OpTestHMC.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def get_ioslots_assigned_to_lpar(self, lpar_profile=None):
f" --filter 'lpar_names={self.lpar_name},"
f"profile_names={lpar_profile}' -F io_slots")
log.info(f"assigned_io_slots:{assigned_io_slots}")
return [] if assigned_io_slots is "none" \
return [] if assigned_io_slots == "none" \
else assigned_io_slots[0].replace('"', "").split(",")

def get_lpar_name_for_ioslot(self, ioslot):
Expand Down
6 changes: 3 additions & 3 deletions common/OpTestInstallUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def wait_for_network(self):
return True
except CommandFailed as cf:
log.debug("wait_for_network CommandFailed={}".format(cf))
if cf.exitcode is 1:
if cf.exitcode == 1:
time.sleep(5)
retry = retry - 1
pass
Expand Down Expand Up @@ -118,7 +118,7 @@ def ping_network(self):
if retry == 1:
log.debug("ping_network raise cf={}".format(cf))
raise cf
if cf.exitcode is 1:
if cf.exitcode == 1:
time.sleep(5)
retry = retry - 1
log.debug(
Expand Down Expand Up @@ -217,7 +217,7 @@ def get_server_ip(self):
break
except CommandFailed as cf:
log.debug("get_server_ip CommandFailed cf={}".format(cf))
if cf.exitcode is 1:
if cf.exitcode == 1:
time.sleep(1)
retry = retry - 1
pass
Expand Down
2 changes: 1 addition & 1 deletion testcases/OpTestFastReboot.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def runTest(self):
"/proc/device-tree/ibm,opal/fast-reboot: {}"
.format(fast_reboot_state[:-1]))
except CommandFailed as cf:
if cf.exitcode is not 1:
if cf.exitcode != 1:
raise cf

cpu = ''.join(c.run_command(
Expand Down
2 changes: 1 addition & 1 deletion testcases/OpTestHMIHandling.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def disable_cpu_idle_states(self):
states = self.cv_HOST.host_run_command(
"find /sys/devices/system/cpu/cpu*/cpuidle/state* -type d | cut -d'/' -f8 | sort -u | sed -e 's/^state//'", console=1)
for state in states:
if state is "0":
if state == "0":
try:
self.cv_HOST.host_run_command(
"cpupower idle-set -e 0", console=1)
Expand Down
2 changes: 1 addition & 1 deletion testcases/OpalMsglog.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def runTest(self):
self.assertTrue(len(log_entries) == 0,
"Warnings/Errors in OPAL log:\n%s" % msg)
except CommandFailed as cf:
if cf.exitcode is 1 and len(cf.output) is 0:
if cf.exitcode == 1 and len(cf.output) == 0:
# We have no warnings/errors!
pass
else:
Expand Down

0 comments on commit 13b30fe

Please sign in to comment.