From 8accc13a3ab30116bca826606416a576706fc9cd Mon Sep 17 00:00:00 2001 From: Rob Dobson Date: Thu, 23 Oct 2014 13:06:50 +0100 Subject: [PATCH] Adding chassis_type to dmidecode regex's Signed-off-by: Rob Dobson --- hwinfo/host/dmidecode.py | 2 ++ hwinfo/host/tests/test_dmidecode.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/hwinfo/host/dmidecode.py b/hwinfo/host/dmidecode.py index a4e6b70..d989bd6 100644 --- a/hwinfo/host/dmidecode.py +++ b/hwinfo/host/dmidecode.py @@ -14,6 +14,8 @@ class DmidecodeParser(CommandParser): r'System\ Information\n(.)*\n\tProduct\ Name:\ (?P.*)\n', r'System\ Information\n(.)*\n(.)*\n(.)*\n\tSerial\ Number:\ (?P.*)\n', r'System\ Information\n(.)*\n(.)*\n(.)*\n(.)*\n\tUUID:\ (?P.*)\n', + # Chassis Info + r'Chassis\ Information\n(.)*\n\tType:\ (?P.*)\n', ] diff --git a/hwinfo/host/tests/test_dmidecode.py b/hwinfo/host/tests/test_dmidecode.py index 34419ce..7166297 100644 --- a/hwinfo/host/tests/test_dmidecode.py +++ b/hwinfo/host/tests/test_dmidecode.py @@ -17,6 +17,7 @@ class DmidecodeParserTests(unittest.TestCase): 'system_product_name': 'PowerEdge R310', 'system_serial_number': 'GZ7BS4J', 'system_uuid': '4C4C4544-005A-3710-8042-C7C04F53344A', + 'chassis_type': 'Rack Mount Chassis', } @@ -50,3 +51,6 @@ def test_dmidecode_system_serial_number(self): def test_dmidecode_system_uuid(self): return self._assert_equal('system_uuid') + + def test_dmidecode_chassis_type(self): + return self._assert_equal('chassis_type')