Skip to content

Commit 9401efd

Browse files
vasant17jleveque
authored andcommitted
Read config DB for running interface(s) and display per port/interface (sonic-net#594)
Signed-off-by: Vasant Patil <[email protected]>
1 parent dcee5fc commit 9401efd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

show/main.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1424,12 +1424,12 @@ def acl(verbose):
14241424
@runningconfiguration.command()
14251425
@click.argument('portname', required=False)
14261426
@click.option('--verbose', is_flag=True, help="Enable verbose output")
1427-
def ports(interfacename, verbose):
1427+
def ports(portname, verbose):
14281428
"""Show ports running configuration"""
14291429
cmd = "sonic-cfggen -d --var-json PORT"
14301430

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

14341434
run_command(cmd, display_cmd=verbose)
14351435

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

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

14571457
run_command(cmd, display_cmd=verbose)
14581458

0 commit comments

Comments
 (0)