aboutsummaryrefslogtreecommitdiff
path: root/ca/rpkigui-query-routes
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2015-10-19 03:36:42 +0000
committerRob Austein <sra@hactrn.net>2015-10-19 03:36:42 +0000
commit7f5e75188ad4527e3c3425a155dfed0847a389dd (patch)
tree400301cae01f51141e380664cf0b382b8204a00d /ca/rpkigui-query-routes
parent7ab6040f7eb05a7ac4424e0294d228256e9a64dd (diff)
Amputate old SQL code out of rpkid with a fire axe, replacing it with
Django ORM. Duct tape and bailing wire everywhere, much clean-up left to do, but basic "make yamltest" suite runs. Much of the clean-up isn't worth doing until after revamping the I/O system, as it'll all change again at that point anyway. svn path=/branches/tk705/; revision=6127
Diffstat (limited to 'ca/rpkigui-query-routes')
-rwxr-xr-xca/rpkigui-query-routes16
1 files changed, 8 insertions, 8 deletions
diff --git a/ca/rpkigui-query-routes b/ca/rpkigui-query-routes
index 179f8c2c..dc2835a0 100755
--- a/ca/rpkigui-query-routes
+++ b/ca/rpkigui-query-routes
@@ -49,17 +49,17 @@ qs = rv.RouteOrigin.objects.filter(
prefix_max__gte=r.max
)
-def validity_marker(route, roa, roa_prefix):
- "Return + if the roa would cause the route to be accepted, or - if not"
- # we already know the ROA covers this route because they are returned
- # from RouteOrigin.roas, so just check the ASN and max prefix length
- return '-' if (roa.asid == 0 or route.asn != roa.asid or
- route.prefixlen > roa_prefix.max_length) else '+'
-
# xxx.xxx.xxx.xxx/xx-xx is 22 characters
+# we already know the ROA covers this route because they are returned
+# from RouteOrigin.roas, so just check the ASN and max prefix length
+
for route in qs:
print route.as_resource_range(), route.asn, route.status
for pfx in route.roa_prefixes:
for roa in pfx.roas.all():
- print validity_marker(route, roa, pfx), pfx.as_roa_prefix(), roa.asid, roa.repo.uri
+ if roa.asid == 0 or route.asn != roa.asid or route.prefixlen > pfx.max_length:
+ validity_marker = '-'
+ else:
+ validity_marker = '+'
+ print validity_marker, pfx.as_roa_prefix(), roa.asid, roa.repo.uri
print