Skip to content

Commit

Permalink
[show] Add and rename 'show interfaces transceiver' subcommands (eepr…
Browse files Browse the repository at this point in the history
…om, lpmode, presence) (sonic-net#182)
  • Loading branch information
jleveque authored Jan 11, 2018
1 parent 6823ce2 commit 94e2bb0
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions show/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,15 @@ def transceiver():

@transceiver.command()
@click.argument('interfacename', required=False)
def basic(interfacename):
"""Show basic interface transceiver information"""
@click.option('-d', '--dom', 'dump_dom', is_flag=True, help="Also display Digital Optical Monitoring (DOM) data")
def eeprom(interfacename, dump_dom):
"""Show interface transceiver EEPROM information"""

command = "sudo sfputil show eeprom"

if dump_dom:
command += " --dom"

if interfacename is not None:
command += " -p {}".format(interfacename)

Expand All @@ -244,10 +248,22 @@ def basic(interfacename):

@transceiver.command()
@click.argument('interfacename', required=False)
def details(interfacename):
"""Show interface transceiver details (Digital Optical Monitoring)"""
def lpmode(interfacename):
"""Show interface transceiver low-power mode status"""

command = "sudo sfputil show lpmode"

if interfacename is not None:
command += " -p {}".format(interfacename)

run_command(command)

@transceiver.command()
@click.argument('interfacename', required=False)
def presence(interfacename):
"""Show interface transceiver presence"""

command = "sudo sfputil show eeprom --dom"
command = "sudo sfputil show presence"

if interfacename is not None:
command += " -p {}".format(interfacename)
Expand Down

0 comments on commit 94e2bb0

Please sign in to comment.