Skip to content

Commit

Permalink
Workaround for Supermicro default serial number
Browse files Browse the repository at this point in the history
Solution provided by @Garfunkl (Simon Brandstetter).
See details of the problem and solution in: #296
  • Loading branch information
TiagoTT committed Nov 4, 2024
1 parent 4150d5e commit e47dcc9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions netbox_agent/vendors/supermicro.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,13 @@ def get_blade_slot(self):
return None

def get_service_tag(self):
if self.is_blade():
return self.baseboard[0]['Serial Number'].strip()
return self.system[0]['Serial Number'].strip()
default_serial = "0123456789"
baseboard_serial = self.baseboard[0]['Serial Number'].strip()
system_serial = str(self.system[0]['Serial Number']).strip()

if self.is_blade() or system_serial == default_serial:
return baseboard_serial
return system_serial

def get_product_name(self):
if self.is_blade():
Expand Down

0 comments on commit e47dcc9

Please sign in to comment.