strip dmidecode data, because vendor dont (#72)
This commit is contained in:
parent
0cf2d4fa90
commit
5c1e15f9e6
2 changed files with 6 additions and 6 deletions
6
netbox_agent/vendors/dell.py
vendored
6
netbox_agent/vendors/dell.py
vendored
|
@ -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):
|
||||
|
|
6
netbox_agent/vendors/qct.py
vendored
6
netbox_agent/vendors/qct.py
vendored
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue