Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
226 changes: 0 additions & 226 deletions clear/bgp_frr_v4.py

This file was deleted.

114 changes: 0 additions & 114 deletions clear/bgp_frr_v6.py

This file was deleted.

23 changes: 16 additions & 7 deletions clear/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,20 +151,29 @@ def ipv6():


#
# Inserting BGP functionality into cli's clear parse-chain. The insertion point
# and the specific BGP commands to import, will be determined by the routing-stack
# being elected.
# Inserting BGP functionality into cli's clear parse-chain.
# BGP commands are determined by the routing-stack being elected.
#
if routing_stack == "quagga":
from .bgp_quagga_v4 import bgp
ip.add_command(bgp)
from .bgp_quagga_v6 import bgp
ipv6.add_command(bgp)
elif routing_stack == "frr":
from .bgp_frr_v4 import bgp
cli.add_command(bgp)
from .bgp_frr_v6 import bgp
cli.add_command(bgp)
@cli.command()
@click.argument('bgp_args', nargs = -1, required = False)
def bgp(bgp_args):
"""BGP information"""
bgp_cmd = "clear bgp"
options = False
for arg in bgp_args:
bgp_cmd += " " + str(arg)
options = True
if options is True:
command = 'sudo vtysh -c "{}"'.format(bgp_cmd)
else:
command = 'sudo vtysh -c "clear bgp *"'
run_command(command)


@cli.command()
Expand Down
Loading