From a2d31a3a6c67aa8ab61c7e54311eb46446b09a84 Mon Sep 17 00:00:00 2001 From: TimStallard <code@timstallard.me.uk> Date: Wed, 30 Jan 2019 18:34:46 +0000 Subject: [PATCH] remove use of proto_default in routes, handled by bird/traceroute functions now --- lg.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lg.py b/lg.py index 8e5477c..bfd97f6 100644 --- a/lg.py +++ b/lg.py @@ -234,7 +234,7 @@ SUMMARY_UNWANTED_PROTOS = ["Kernel", "Static", "Device", "BFD", "Direct"] @app.route("/summary/<hosts>") @app.route("/summary/<hosts>/<proto>") -def summary(hosts, proto=app.config.get("PROTO_DEFAULT", "ipv4")): +def summary(hosts, proto="ipv4"): set_session("summary", hosts, proto, "") command = "show protocols" @@ -288,7 +288,7 @@ def summary(hosts, proto=app.config.get("PROTO_DEFAULT", "ipv4")): @app.route("/detail/<hosts>") @app.route("/detail/<hosts>/<proto>") -def detail(hosts, proto=app.config.get("PROTO_DEFAULT", "ipv4")): +def detail(hosts, proto="ipv4"): name = get_query() if not name: @@ -321,7 +321,7 @@ def detail(hosts, proto=app.config.get("PROTO_DEFAULT", "ipv4")): @app.route("/traceroute/<hosts>") @app.route("/traceroute/<hosts>/<proto>") -def traceroute(hosts, proto=app.config.get("PROTO_DEFAULT", "ipv4")): +def traceroute(hosts, proto="ipv4"): q = get_query() if not q: @@ -372,49 +372,49 @@ def traceroute(hosts, proto=app.config.get("PROTO_DEFAULT", "ipv4")): @app.route("/adv/<hosts>") @app.route("/adv/<hosts>/<proto>") -def show_route_filter(hosts, proto=app.config.get("PROTO_DEFAULT", "ipv4")): +def show_route_filter(hosts, proto="ipv4"): return show_route("adv", hosts, proto) @app.route("/adv_bgpmap/<hosts>") @app.route("/adv_bgpmap/<hosts>/<proto>") -def show_route_filter_bgpmap(hosts, proto=app.config.get("PROTO_DEFAULT", "ipv4")): +def show_route_filter_bgpmap(hosts, proto="ipv4"): return show_route("adv_bgpmap", hosts, proto) @app.route("/where/<hosts>") @app.route("/where/<hosts>/<proto>") -def show_route_where(hosts, proto=app.config.get("PROTO_DEFAULT", "ipv4")): +def show_route_where(hosts, proto="ipv4"): return show_route("where", hosts, proto) @app.route("/where_detail/<hosts>") @app.route("/where_detail/<hosts>/<proto>") -def show_route_where_detail(hosts, proto=app.config.get("PROTO_DEFAULT", "ipv4")): +def show_route_where_detail(hosts, proto="ipv4"): return show_route("where_detail", hosts, proto) @app.route("/where_bgpmap/<hosts>") @app.route("/where_bgpmap/<hosts>/<proto>") -def show_route_where_bgpmap(hosts, proto=app.config.get("PROTO_DEFAULT", "ipv4")): +def show_route_where_bgpmap(hosts, proto="ipv4"): return show_route("where_bgpmap", hosts, proto) @app.route("/prefix/<hosts>") @app.route("/prefix/<hosts>/<proto>") -def show_route_for(hosts, proto=app.config.get("PROTO_DEFAULT", "ipv4")): +def show_route_for(hosts, proto="ipv4"): return show_route("prefix", hosts, proto) @app.route("/prefix_detail/<hosts>") @app.route("/prefix_detail/<hosts>/<proto>") -def show_route_for_detail(hosts, proto=app.config.get("PROTO_DEFAULT", "ipv4")): +def show_route_for_detail(hosts, proto="ipv4"): return show_route("prefix_detail", hosts, proto) @app.route("/prefix_bgpmap/<hosts>") @app.route("/prefix_bgpmap/<hosts>/<proto>") -def show_route_for_bgpmap(hosts, proto=app.config.get("PROTO_DEFAULT", "ipv4")): +def show_route_for_bgpmap(hosts, proto="ipv4"): return show_route("prefix_bgpmap", hosts, proto)