Fixed PEP 8 style using autopep8
Used autopep8 to correct styling.
Ran autopep8 on openbmc-test-automation, autopep8 is not
able to fix all styling issues. There is still around
1000 styling violations in openbmc-test-automation.
More information on autopep8 can be found here,
https://pypi.python.org/pypi/autopep8
Change-Id: Iddc131da1d74d978eb3dd0fdd6ce5d0a0e49b0f8
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/lib/utilities.py b/lib/utilities.py
index 4a7ea42..8f23b33 100755
--- a/lib/utilities.py
+++ b/lib/utilities.py
@@ -14,7 +14,8 @@
Example: 00:01:6C:80:02:78
"""
return ":".join(map(lambda x: "%02x" % x, (random.randint(0x00, 0xff)
- for _ in range(6))))
+ for _ in range(6))))
+
def random_ip():
r"""
@@ -22,7 +23,8 @@
Example: 9.3.128.100
"""
return ".".join(map(str, (random.randint(0, 255)
- for _ in range(4))))
+ for _ in range(4))))
+
def get_sensor(module_name, value):
m = imp.load_source('module.name', module_name)
@@ -35,7 +37,7 @@
return 0xFF
-def get_inventory_sensor (module_name, value):
+def get_inventory_sensor(module_name, value):
m = imp.load_source('module.name', module_name)
value = string.replace(value, m.INVENTORY_ROOT, '<inventory_root>')
@@ -61,10 +63,9 @@
l = []
m = imp.load_source('module.name', module_name)
-
for i in m.ID_LOOKUP['FRU']:
s = m.ID_LOOKUP['FRU'][i]
- s = s.replace('<inventory_root>',m.INVENTORY_ROOT)
+ s = s.replace('<inventory_root>', m.INVENTORY_ROOT)
l.append(s)
return l
@@ -78,13 +79,13 @@
# [/org/openbmc/inventory//system/chassis/motherboard/cpu0,
# /org/openbmc/inventory//system/chassis/motherboard/cpu1]
################################################################
-def get_inventory_fru_type_list(module_name, fru):
+def get_inventory_fru_type_list(module_name, fru):
l = []
m = imp.load_source('module.name', module_name)
for i in m.FRU_INSTANCES.keys():
if m.FRU_INSTANCES[i]['fru_type'] == fru:
- s = i.replace('<inventory_root>',m.INVENTORY_ROOT)
+ s = i.replace('<inventory_root>', m.INVENTORY_ROOT)
l.append(s)
return l
@@ -98,7 +99,7 @@
# [/org/openbmc/inventory/system/chassis/motherboard/dimm0,
# /org/openbmc/inventory/system/chassis/motherboard/dimm1]
################################################################
-def get_vpd_inventory_list(module_name, fru):
+def get_vpd_inventory_list(module_name, fru):
l = []
m = imp.load_source('module.name', module_name)
@@ -106,7 +107,7 @@
x = m.ID_LOOKUP['FRU_STR'][i]
if m.FRU_INSTANCES[x]['fru_type'] == fru:
- s = x.replace('<inventory_root>',m.INVENTORY_ROOT)
+ s = x.replace('<inventory_root>', m.INVENTORY_ROOT)
l.append(s)
return l
@@ -121,11 +122,10 @@
if __name__ == "__main__":
- main()
+ main()
def get_mtr_report(host=""):
-
r"""
Get an mtr report and return it as a dictionary of dictionaries.
@@ -197,7 +197,6 @@
def get_mtr_row(host=""):
-
r"""
Run an mtr report and get a specified row and return it as a dictionary.