Skip to content

Commit 3d03c13

Browse files
romankachur-mlnxlguohan
authored andcommitted
Removed 'show interfaces alias and show interfaces summary'. (sonic-net#412)
Removed 'show interfaces summary'.
1 parent fda7742 commit 3d03c13

File tree

1 file changed

+0
-54
lines changed

1 file changed

+0
-54
lines changed

show/main.py

-54
Original file line numberDiff line numberDiff line change
@@ -408,43 +408,6 @@ def interfaces():
408408
"""Show details of the network interfaces"""
409409
pass
410410

411-
# 'alias' subcommand ("show interfaces alias")
412-
@interfaces.command()
413-
@click.argument('interfacename', required=False)
414-
def alias(interfacename):
415-
"""Show Interface Name/Alias Mapping"""
416-
417-
cmd = 'sonic-cfggen -d --var-json "PORT"'
418-
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
419-
420-
port_dict = json.loads(p.stdout.read())
421-
422-
header = ['Name', 'Alias']
423-
body = []
424-
425-
if interfacename is not None:
426-
if get_interface_mode() == "alias":
427-
interfacename = iface_alias_converter.alias_to_name(interfacename)
428-
429-
# If we're given an interface name, output name and alias for that interface only
430-
if interfacename in port_dict:
431-
if 'alias' in port_dict[interfacename]:
432-
body.append([interfacename, port_dict[interfacename]['alias']])
433-
else:
434-
body.append([interfacename, interfacename])
435-
else:
436-
click.echo("Invalid interface name, '{0}'".format(interfacename))
437-
return
438-
else:
439-
# Output name and alias for all interfaces
440-
for port_name in natsorted(port_dict.keys()):
441-
if 'alias' in port_dict[port_name]:
442-
body.append([port_name, port_dict[port_name]['alias']])
443-
else:
444-
body.append([port_name, port_name])
445-
446-
click.echo(tabulate(body, header))
447-
448411
#
449412
# 'neighbor' group ###
450413
#
@@ -493,23 +456,6 @@ def expected(interfacename):
493456

494457
click.echo(tabulate(body, header))
495458

496-
# 'summary' subcommand ("show interfaces summary")
497-
@interfaces.command()
498-
@click.argument('interfacename', required=False)
499-
@click.option('--verbose', is_flag=True, help="Enable verbose output")
500-
def summary(interfacename, verbose):
501-
"""Show interface status and information"""
502-
503-
cmd = "/sbin/ifconfig"
504-
505-
if interfacename is not None:
506-
if get_interface_mode() == "alias":
507-
interfacename = iface_alias_converter.alias_to_name(interfacename)
508-
509-
cmd += " {}".format(interfacename)
510-
511-
run_command(cmd, display_cmd=verbose)
512-
513459

514460
@interfaces.group(cls=AliasedGroup, default_if_no_args=False)
515461
def transceiver():

0 commit comments

Comments
 (0)