summaryrefslogtreecommitdiffstats
path: root/src/hardware
diff options
context:
space:
mode:
authorRobin Hack <rhack@redhat.com>2014-01-31 13:07:44 +0100
committerRobin Hack <rhack@redhat.com>2014-01-31 14:28:04 +0100
commit60637b8dbf80157b362ed268f1bfec9d3954ae70 (patch)
treea78f080d504bd790e7eb9ff3bab244a8bc4e0d7e /src/hardware
parentdcf61cf98d608f430c3ed516f8a5041d7faf4a22 (diff)
downloadopenlmi-providers-60637b8dbf80157b362ed268f1bfec9d3954ae70.tar.gz
openlmi-providers-60637b8dbf80157b362ed268f1bfec9d3954ae70.tar.xz
openlmi-providers-60637b8dbf80157b362ed268f1bfec9d3954ae70.zip
Hardware: Fixes from review.
Diffstat (limited to 'src/hardware')
-rw-r--r--src/hardware/test/TestHardwareBase.py25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/hardware/test/TestHardwareBase.py b/src/hardware/test/TestHardwareBase.py
index a3b4083..67ec555 100644
--- a/src/hardware/test/TestHardwareBase.py
+++ b/src/hardware/test/TestHardwareBase.py
@@ -111,7 +111,6 @@ def parse_dmi_output(dmioutput):
# skip one line of dmidecode output
skip_line = True
continue
- pprint (devices)
return devices
def get_dmi_output(type_p):
@@ -436,19 +435,25 @@ class HardwarePhysicalMemoryTestCase(HardwareTestCase):
if module["Size"] == "No Module Installed":
continue
+ def convert(x):
+ if x == -1:
+ return None
+ else:
+ return x
+
tuples.append((
- int(module.get("Total Width", "0").split(" ")[0]),
- int(module.get("Data Width", "0").split(" ")[0]),
- int(module.get("Size", 0).split(" ")[0]) * 1024 * 1024,
- module.get("Serial Number", "0"),
+ int(module.get("Total Width", "0").split(" ")[0]), # 0
+ int(module.get("Data Width", "0").split(" ")[0]), # 1
+ int(module.get("Size", 0).split(" ")[0]) * 1024 * 1024, # 2
+ module.get("Serial Number", "0"), # 3
# skipped for now
#module.get("Bank Locator", ""),
#module.get("Locator", ""),
- self.form_factor_table[module.get("Form Factor", "Unknown")],
- self.memory_type_table[module.get("Type", "Unknown")],
- module.get("Manufacturer", ""),
- module.get("Part Number", ""),
- int(module.get("Speed", "0 MHz").split(" ")[0])
+ self.form_factor_table[module.get("Form Factor", "Unknown")], # 4
+ self.memory_type_table[module.get("Type", "Unknown")], # 5
+ module.get("Manufacturer", ""), # 6
+ module.get("Part Number", ""), # 7
+ convert(int(module.get("Speed", "-1 Mhz").split(" ")[0])) # 8
))
# I just belive that order is achieved...