strip dmidecode data, because vendor dont (#72)

This commit is contained in:
Solvik 2019-09-10 13:39:22 +02:00 committed by GitHub
parent 0cf2d4fa90
commit 5c1e15f9e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -20,7 +20,7 @@ class DellHost(ServerBase):
` Location In Chassis: Slot 03`
"""
if self.is_blade():
return self.dmi.get_by_type('Baseboard')[0].get('Location In Chassis')
return self.dmi.get_by_type('Baseboard')[0].get('Location In Chassis').strip()
return None
def get_chassis_name(self):
@ -30,12 +30,12 @@ class DellHost(ServerBase):
def get_chassis(self):
if self.is_blade():
return self.dmi.get_by_type('Chassis')[0]['Version']
return self.dmi.get_by_type('Chassis')[0]['Version'].strip()
return self.get_product_name()
def get_chassis_service_tag(self):
if self.is_blade():
return self.dmi.get_by_type('Chassis')[0]['Serial Number']
return self.dmi.get_by_type('Chassis')[0]['Serial Number'].strip()
return self.get_service_tag()
def get_power_consumption(self):

View file

@ -12,7 +12,7 @@ class QCTHost(ServerBase):
def get_blade_slot(self):
if self.is_blade():
return 'Slot {}'.format(
self.dmi.get_by_type('Baseboard')[0].get('Location In Chassis')
self.dmi.get_by_type('Baseboard')[0].get('Location In Chassis').strip()
)
return None
@ -23,10 +23,10 @@ class QCTHost(ServerBase):
def get_chassis(self):
if self.is_blade():
return self.dmi.get_by_type('Chassis')[0]['Version']
return self.dmi.get_by_type('Chassis')[0]['Version'].strip()
return self.get_product_name()
def get_chassis_service_tag(self):
if self.is_blade():
return self.dmi.get_by_type('Chassis')[0]['Serial Number']
return self.dmi.get_by_type('Chassis')[0]['Serial Number'].strip()
return self.get_service_tag()