Skip to content

Commit 2f4a3b6

Browse files
tsvanduynjleveque
authored andcommitted
add show route-map and show ip prefix-list commands (sonic-net#429)
1 parent f7d46ed commit 2f4a3b6

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

show/main.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,21 @@ def mac(vlan, port, verbose):
791791

792792
run_command(cmd, display_cmd=verbose)
793793

794+
#
795+
# 'show route-map' command ("show route-map")
796+
#
797+
798+
@cli.command('route-map')
799+
@click.argument('route_map_name', required=False)
800+
@click.option('--verbose', is_flag=True, help="Enable verbose output")
801+
def route_map(route_map_name, verbose):
802+
"""show route-map"""
803+
cmd = 'sudo vtysh -c "show route-map'
804+
if route_map_name is not None:
805+
cmd += ' {}'.format(route_map_name)
806+
cmd += '"'
807+
run_command(cmd, display_cmd=verbose)
808+
794809
#
795810
# 'ip' group ("show ip ...")
796811
#
@@ -901,6 +916,22 @@ def route(ipaddress, verbose):
901916

902917
run_command(cmd, display_cmd=verbose)
903918

919+
#
920+
# 'prefix-list' subcommand ("show ip prefix-list")
921+
#
922+
923+
@ip.command('prefix-list')
924+
@click.argument('prefix_list_name', required=False)
925+
@click.option('--verbose', is_flag=True, help="Enable verbose output")
926+
def prefix_list(prefix_list_name, verbose):
927+
"""show ip prefix-list"""
928+
cmd = 'sudo vtysh -c "show ip prefix-list'
929+
if prefix_list_name is not None:
930+
cmd += ' {}'.format(prefix_list_name)
931+
cmd += '"'
932+
run_command(cmd, display_cmd=verbose)
933+
934+
904935
# 'protocol' command
905936
@ip.command()
906937
@click.option('--verbose', is_flag=True, help="Enable verbose output")

0 commit comments

Comments
 (0)