Formatted python files to follow PEP 8 python code standards.
- Changed the python files in the openbmc-test-automation
directory to conform to python code style standards with
the exception of E402 and E501.
- Resolves openbmc/openbmc-test-automation#1308
Change-Id: I109995c2d248f5a6bb2c0e3c76a6144c8f3aac2e
Signed-off-by: Joy Onyerikwu <onyekachukwu.joy.onyerikwu@ibm.com>
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>
diff --git a/lib/state.py b/lib/state.py
index cddcf79..d078483 100755
--- a/lib/state.py
+++ b/lib/state.py
@@ -536,8 +536,8 @@
# wait_until_keyword_succeeds to ensure a non-blank value is obtained.
remote_cmd_buf = "read uptime filler 2>/dev/null < /proc/uptime" +\
" && [ ! -z \"${uptime}\" ] && echo ${uptime}"
- cmd_buf = ["BMC Execute Command", re.sub(r'\$', '\$', remote_cmd_buf),
- 'quiet=1']
+ cmd_buf = ["BMC Execute Command",
+ re.sub(r'\\$', '\\$', remote_cmd_buf), 'quiet=1']
if not quiet:
grp.rpissuing_keyword(cmd_buf)
grp.rpissuing(remote_cmd_buf)
@@ -592,7 +592,7 @@
for url_path in ret_values:
for attr_name in ret_values[url_path]:
# Create a state key value based on the attr_name.
- if type(ret_values[url_path][attr_name]) is unicode:
+ if isinstance(ret_values[url_path][attr_name], unicode):
ret_values[url_path][attr_name] = \
re.sub(r'.*\.', "",
ret_values[url_path][attr_name])
@@ -783,9 +783,9 @@
alt_text = "cease to "
else:
alt_text = ""
- gp.print_timen("Checking every " + str(interval) + " for up to " +
- str(wait_time) + " for the state of the machine to " +
- alt_text + "match the state shown below.")
+ gp.print_timen("Checking every " + str(interval) + " for up to "
+ + str(wait_time) + " for the state of the machine to "
+ + alt_text + "match the state shown below.")
gp.print_var(match_state)
if quiet:
@@ -864,7 +864,7 @@
# a reboot has indeed occurred (vs random network instability giving a
# false positive. We also use wait_state because the BMC may take a short
# while to be ready to process SSH requests.
- match_state = DotDict([('uptime', '^[0-9\.]+$'),
+ match_state = DotDict([('uptime', '^[0-9\\.]+$'),
('epoch_seconds', '^[0-9]+$')])
state = wait_state(match_state, wait_time="2 mins", interval="1 second")
@@ -877,8 +877,8 @@
if int(float(state['uptime'])) < elapsed_boot_time:
uptime = state['uptime']
gp.qprint_var(uptime)
- gp.qprint_timen("The uptime is less than the elapsed boot time," +
- " as expected.")
+ gp.qprint_timen("The uptime is less than the elapsed boot time,"
+ + " as expected.")
else:
error_message = "The uptime is greater than the elapsed boot time," +\
" which is unexpected:\n" +\