Skip to content

Commit

Permalink
add show route-map and show ip prefix-list commands (sonic-net#429)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsvanduyn authored and jleveque committed Jan 17, 2019
1 parent f7d46ed commit 2f4a3b6
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions show/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,21 @@ def mac(vlan, port, verbose):

run_command(cmd, display_cmd=verbose)

#
# 'show route-map' command ("show route-map")
#

@cli.command('route-map')
@click.argument('route_map_name', required=False)
@click.option('--verbose', is_flag=True, help="Enable verbose output")
def route_map(route_map_name, verbose):
"""show route-map"""
cmd = 'sudo vtysh -c "show route-map'
if route_map_name is not None:
cmd += ' {}'.format(route_map_name)
cmd += '"'
run_command(cmd, display_cmd=verbose)

#
# 'ip' group ("show ip ...")
#
Expand Down Expand Up @@ -901,6 +916,22 @@ def route(ipaddress, verbose):

run_command(cmd, display_cmd=verbose)

#
# 'prefix-list' subcommand ("show ip prefix-list")
#

@ip.command('prefix-list')
@click.argument('prefix_list_name', required=False)
@click.option('--verbose', is_flag=True, help="Enable verbose output")
def prefix_list(prefix_list_name, verbose):
"""show ip prefix-list"""
cmd = 'sudo vtysh -c "show ip prefix-list'
if prefix_list_name is not None:
cmd += ' {}'.format(prefix_list_name)
cmd += '"'
run_command(cmd, display_cmd=verbose)


# 'protocol' command
@ip.command()
@click.option('--verbose', is_flag=True, help="Enable verbose output")
Expand Down

0 comments on commit 2f4a3b6

Please sign in to comment.