diff options
author | Michael Elkins <melkins@tislabs.com> | 2012-02-07 00:58:28 +0000 |
---|---|---|
committer | Michael Elkins <melkins@tislabs.com> | 2012-02-07 00:58:28 +0000 |
commit | e4c5873f3c320da087d5ccd7bfa64534f97c87fc (patch) | |
tree | 6b38d310fe9ce5fa205ed044c2c25c70a636fa9c /rpkid/rpki/gui/app/views.py | |
parent | 7dbde51c8ee64c36ca37ada24a33afcdee2c0909 (diff) |
coerce min/max value back to appropriate datum_type for the range
svn path=/branches/tk161/; revision=4296
Diffstat (limited to 'rpkid/rpki/gui/app/views.py')
-rw-r--r-- | rpkid/rpki/gui/app/views.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/rpkid/rpki/gui/app/views.py b/rpkid/rpki/gui/app/views.py index d238be55..abfddc72 100644 --- a/rpkid/rpki/gui/app/views.py +++ b/rpkid/rpki/gui/app/views.py @@ -464,6 +464,27 @@ def roa_create(request): match = roa_match(rng) for route, roas in match: validate_route(route, roas) + # tweak the validation status due to the presence of the + # new ROA. Don't need to check the prefix bounds here + # because all the matches routes will be covered by this + # new ROA + if route.status == 'unknown': + # if the route was previously unknown (no covering + # ROAs), then: + # if the AS matches, it is valid, otherwise invalid + if route.asn == asn: + route.status = 'valid' + route.status_label = 'success' + else: + route.status = 'invalid' + route.status_label = 'important' + elif route.status == 'invalid': + # if the route was previously invalid, but this new ROA + # matches the ASN, it is now valid + if route.asn == asn: + route.status = 'valid' + route.status_label = 'success' + routes.append(route) else: form = forms.ROARequest() |