black: re-format
black and isort are enabled in the openbmc-build-scripts on Python files
to have a consistent formatting. Re-run the formatter on the whole
repository.
Change-Id: If1010ead857d41364c024bf8145a979a9377d382
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/lib/pel_utils.py b/lib/pel_utils.py
index b06124c..50eefd3 100644
--- a/lib/pel_utils.py
+++ b/lib/pel_utils.py
@@ -4,13 +4,13 @@
PEL functions.
"""
-import func_args as fa
-import bmc_ssh_utils as bsu
-import pel_variables
-
import json
import os
import sys
+
+import bmc_ssh_utils as bsu
+import func_args as fa
+import pel_variables
from robot.libraries.BuiltIn import BuiltIn
base_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@@ -56,7 +56,9 @@
"""
bsu_options = fa.args_to_objects(bsu_options)
- out_buf, stderr, rc = bsu.bmc_execute_command('peltool ' + option_string, **bsu_options)
+ out_buf, stderr, rc = bsu.bmc_execute_command(
+ "peltool " + option_string, **bsu_options
+ )
if parse_json:
try:
return json.loads(out_buf)
@@ -65,8 +67,9 @@
return out_buf
-def get_pel_data_from_bmc(include_hidden_pels=False,
- include_informational_pels=False):
+def get_pel_data_from_bmc(
+ include_hidden_pels=False, include_informational_pels=False
+):
r"""
Returns PEL data from BMC else throws exception.
@@ -109,13 +112,19 @@
pel_id_list = pel_data.keys()
for pel_id in pel_id_list:
# Check if required SRC ID with severity is present
- if ((pel_data[pel_id]["SRC"] == src_id) and (pel_data[pel_id]["Sev"] == severity)):
+ if (pel_data[pel_id]["SRC"] == src_id) and (
+ pel_data[pel_id]["Sev"] == severity
+ ):
src_pel_ids.append(pel_id)
if not src_pel_ids:
- raise peltool_exception(src_id + " with severity " + severity + " not present")
+ raise peltool_exception(
+ src_id + " with severity " + severity + " not present"
+ )
except Exception as e:
- raise peltool_exception("Failed to fetch PEL ID for required SRC : " + str(e))
+ raise peltool_exception(
+ "Failed to fetch PEL ID for required SRC : " + str(e)
+ )
return src_pel_ids
@@ -139,7 +148,9 @@
return src_id
-def check_for_unexpected_src(unexpected_src_list=[], include_hidden_pels=False):
+def check_for_unexpected_src(
+ unexpected_src_list=[], include_hidden_pels=False
+):
r"""
From the given unexpected SRC list, check if any unexpected SRC created
on the BMC. Returns 0 if no SRC found else throws exception.
@@ -160,11 +171,13 @@
if src in src_data:
print("Found an unexpected SRC : " + src)
unexpected_src_count = unexpected_src_count + 1
- if (unexpected_src_count >= 1):
+ if unexpected_src_count >= 1:
raise peltool_exception("Unexpected SRC found.")
except Exception as e:
- raise peltool_exception("Failed to verify unexpected SRC list : " + str(e))
+ raise peltool_exception(
+ "Failed to verify unexpected SRC list : " + str(e)
+ )
return unexpected_src_count