Skip to content

Commit 8accc13

Browse files
committed
Adding chassis_type to dmidecode regex's
Signed-off-by: Rob Dobson <[email protected]>
1 parent bab0a3a commit 8accc13

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

hwinfo/host/dmidecode.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ class DmidecodeParser(CommandParser):
1414
r'System\ Information\n(.)*\n\tProduct\ Name:\ (?P<system_product_name>.*)\n',
1515
r'System\ Information\n(.)*\n(.)*\n(.)*\n\tSerial\ Number:\ (?P<system_serial_number>.*)\n',
1616
r'System\ Information\n(.)*\n(.)*\n(.)*\n(.)*\n\tUUID:\ (?P<system_uuid>.*)\n',
17+
# Chassis Info
18+
r'Chassis\ Information\n(.)*\n\tType:\ (?P<chassis_type>.*)\n',
1719
]
1820

1921

hwinfo/host/tests/test_dmidecode.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class DmidecodeParserTests(unittest.TestCase):
1717
'system_product_name': 'PowerEdge R310',
1818
'system_serial_number': 'GZ7BS4J',
1919
'system_uuid': '4C4C4544-005A-3710-8042-C7C04F53344A',
20+
'chassis_type': 'Rack Mount Chassis',
2021
}
2122

2223

@@ -50,3 +51,6 @@ def test_dmidecode_system_serial_number(self):
5051

5152
def test_dmidecode_system_uuid(self):
5253
return self._assert_equal('system_uuid')
54+
55+
def test_dmidecode_chassis_type(self):
56+
return self._assert_equal('chassis_type')

0 commit comments

Comments
 (0)