summaryrefslogtreecommitdiff
path: root/frr-evpn-route-watcher/task.py
diff options
context:
space:
mode:
Diffstat (limited to 'frr-evpn-route-watcher/task.py')
-rwxr-xr-xfrr-evpn-route-watcher/task.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/frr-evpn-route-watcher/task.py b/frr-evpn-route-watcher/task.py
index 4b497ea..ce31d92 100755
--- a/frr-evpn-route-watcher/task.py
+++ b/frr-evpn-route-watcher/task.py
@@ -12,7 +12,7 @@ def get_frr_vrfs():
def get_frr_evpn_info():
"""Lists all the routes learned via evpn"""
process = subprocess.run(
- ["vtysh", "-c", "show ip bgp l2vpn evpn json"], capture_output=True
+ ["vtysh", "-c", "show bgp l2vpn evpn json"], capture_output=True
)
return json.loads(process.stdout)
@@ -26,9 +26,11 @@ def remove_route_vrf(ip):
subprocess.run(["ip", "route", "del", str(ip)])
def currently_routed(vrfs_names):
- process = subprocess.run(["ip", "route"], capture_output=True, text=True)
+ processfour = subprocess.run(["ip", "route"], capture_output=True, text=True).stdout.splitlines()
+ processsixe = subprocess.run(["ip", "-6", "route"], capture_output=True, text=True).stdout.splitlines()
+ processresults = processfour + processsixe
routed_ips = []
- for route in process.stdout.splitlines():
+ for route in processresults:
parts = route.split(" ")
if len(parts) == 6:
addr, dev, vrf, scope, link = (
@@ -110,4 +112,4 @@ def resolve_routes():
print(f"removing route for {remove}")
remove_route_vrf(remove)
-resolve_routes() \ No newline at end of file
+resolve_routes()