remove use of proto_default in routes, handled by bird/traceroute functions now

This commit is contained in:
TimStallard 2019-01-30 18:34:46 +00:00
parent eb91179101
commit a2d31a3a6c
No known key found for this signature in database
GPG Key ID: E18E975C6A734F07

22
lg.py
View File

@ -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)