Skip to content

Commit

Permalink
decode-syseeprom : added new option to show the Product Name. (sonic-…
Browse files Browse the repository at this point in the history
…net#496)

Added a new option -p to display the Product Name.
  • Loading branch information
olivier-singla authored and lguohan committed May 10, 2019
1 parent 09806b8 commit 430d4b8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/decode-syseeprom
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ def get_cmdline_opts():
default=False, help="print eeprom from database")
optcfg.add_option("-s", dest="serial", action="store_true",
default=False, help="print device serial number/service tag")
optcfg.add_option("-p", dest="modelstr", action="store_true", default=False,
help="print the device product name")
optcfg.add_option("-m", dest="mgmtmac", action="store_true", default=False,
help="print the base mac address for management interfaces")
optcfg.add_option("--init", dest="init", action="store_true", default=False,
Expand Down Expand Up @@ -138,6 +140,10 @@ def run(target, opts, args, support_eeprom_db):
print e
else:
print serial or "Undefined."
elif opts.modelstr:
mm = target.modelstr(e)
if mm != None:
print mm
else:
target.decode_eeprom(e)
(is_valid, valid_crc) = target.is_checksum_valid(e)
Expand Down

0 comments on commit 430d4b8

Please sign in to comment.