Skip to content

Commit

Permalink
Read config DB for running interface(s) and display per port/interface (
Browse files Browse the repository at this point in the history
sonic-net#594)

Signed-off-by: Vasant Patil <vapatil@linkedin.com>
  • Loading branch information
vasant17 authored and jleveque committed Aug 15, 2019
1 parent dcee5fc commit 9401efd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions show/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1424,12 +1424,12 @@ def acl(verbose):
@runningconfiguration.command()
@click.argument('portname', required=False)
@click.option('--verbose', is_flag=True, help="Enable verbose output")
def ports(interfacename, verbose):
def ports(portname, verbose):
"""Show ports running configuration"""
cmd = "sonic-cfggen -d --var-json PORT"

if portname is not None:
cmd += " {0} {1}".format("--port", portname)
cmd += " {0} {1}".format("--key", portname)

run_command(cmd, display_cmd=verbose)

Expand All @@ -1449,10 +1449,10 @@ def bgp(verbose):
@click.option('--verbose', is_flag=True, help="Enable verbose output")
def interfaces(interfacename, verbose):
"""Show interfaces running configuration"""
cmd = "cat /etc/network/interfaces"
cmd = "sonic-cfggen -d --var-json INTERFACE"

if interfacename is not None:
cmd += " | grep {} -A 4".format(interfacename)
cmd += " {0} {1}".format("--key", interfacename)

run_command(cmd, display_cmd=verbose)

Expand Down

0 comments on commit 9401efd

Please sign in to comment.