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

@ -24,7 +24,9 @@ class HPHost(ServerBase):
def get_blade_slot(self):
if self.is_blade():
return int(self.hp_rack_locator['Server Bay'].strip())
return 'Bay {}'.format(
int(self.hp_rack_locator['Server Bay'].strip())
)
return None
def get_chassis(self):
@ -32,6 +34,11 @@ class HPHost(ServerBase):
return self.hp_rack_locator['Enclosure Model'].strip()
return self.get_product_name()
def get_chassis_name(self):
if not self.is_blade():
return None
return self.hp_rack_locator['Enclosure Name'].strip()
def get_chassis_service_tag(self):
if self.is_blade():
return self.hp_rack_locator['Enclosure Serial'].strip()