Skip to content

Commit

Permalink
Merge pull request #321 from brandwatch/supermicro-workaround-default…
Browse files Browse the repository at this point in the history
…-serial

Workaround for Supermicro default serial number
  • Loading branch information
CllaudiaB authored Nov 6, 2024
2 parents 8a33fd3 + e47dcc9 commit cdc2629
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 cdc2629

Please sign in to comment.