Skip to content

Commit

Permalink
strip dmidecode data, because vendor dont (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
Solvik authored Sep 10, 2019
1 parent 0cf2d4f commit 5c1e15f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions netbox_agent/vendors/dell.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def get_blade_slot(self):
` 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):
Expand All @@ -30,12 +30,12 @@ def get_chassis_name(self):

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):
Expand Down
6 changes: 3 additions & 3 deletions netbox_agent/vendors/qct.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def is_blade(self):
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

Expand All @@ -23,10 +23,10 @@ def get_chassis_name(self):

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()

0 comments on commit 5c1e15f

Please sign in to comment.