@@ -408,43 +408,6 @@ def interfaces():
408
408
"""Show details of the network interfaces"""
409
409
pass
410
410
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
-
448
411
#
449
412
# 'neighbor' group ###
450
413
#
@@ -493,23 +456,6 @@ def expected(interfacename):
493
456
494
457
click .echo (tabulate (body , header ))
495
458
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
-
513
459
514
460
@interfaces .group (cls = AliasedGroup , default_if_no_args = False )
515
461
def transceiver ():
0 commit comments