support HPE BL460c Gen10 and its stupid dmidecode info (#39)

This commit is contained in:
Solvik 2019-08-21 16:17:01 +02:00 committed by GitHub
parent e25fe3dd07
commit 5826966ea4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 11 deletions

View file

@ -18,9 +18,16 @@ class HPHost(ServerBase):
"""
# FIXME: make a dmidecode function get_by_dminame() ?
if self.is_blade():
for key, value in self.dmi.parse().items():
if value['DMIName'] == 'HP ProLiant System/Rack Locator':
return value
locator = self.dmi.get_by_type(204)
if self.get_product_name() == 'ProLiant BL460c Gen10':
locator = locator[0]['Strings']
return {
'Enclosure Model': locator[2].strip(),
'Enclosure Name': locator[0].strip(),
'Server Bay': locator[3].strip(),
'Enclosure Serial': locator[4].strip(),
}
return locator[0]
def get_blade_slot(self):
if self.is_blade():