fix blade slot

This commit is contained in:
Solvik Blum 2019-08-08 14:37:02 +02:00
parent a7d766a5fb
commit 048fa22b1e
No known key found for this signature in database
GPG key ID: CC12B3DC262B6C47
4 changed files with 81 additions and 52 deletions

View file

@ -12,9 +12,14 @@ class DellHost(ServerBase):
` Location In Chassis: Slot 03`
"""
if self.is_blade():
return int(self.dmi.get_by_type('Baseboard')[0].get('Location In Chassis').split()[1])
return self.dmi.get_by_type('Baseboard')[0].get('Location In Chassis')
return None
def get_chassis_name(self):
if not self.is_blade():
return None
return 'Chassis {}'.format(self.get_service_tag())
def get_chassis(self):
if self.is_blade():
return self.dmi.get_by_type('Chassis')[0]['Version']