aboutsummaryrefslogtreecommitdiff
path: root/rpkid/rpki/gui/cacheview/util.py
diff options
context:
space:
mode:
authorMichael Elkins <melkins@tislabs.com>2013-03-19 17:15:48 +0000
committerMichael Elkins <melkins@tislabs.com>2013-03-19 17:15:48 +0000
commitaa924816b6c468790dc236d5a5f7f74c01e99d9d (patch)
tree1a39e895246f4ee26b6542e7c55d830f98a99c68 /rpkid/rpki/gui/cacheview/util.py
parente1663079bcd11d5ac61c1e11efd8828fea7f8c9d (diff)
need to guard against issuer being None the first time we process the root cert since the object is not yet in the db
closes #475 svn path=/trunk/; revision=5174
Diffstat (limited to 'rpkid/rpki/gui/cacheview/util.py')
-rw-r--r--rpkid/rpki/gui/cacheview/util.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/rpkid/rpki/gui/cacheview/util.py b/rpkid/rpki/gui/cacheview/util.py
index dffa591f..8ba7d89f 100644
--- a/rpkid/rpki/gui/cacheview/util.py
+++ b/rpkid/rpki/gui/cacheview/util.py
@@ -67,15 +67,17 @@ def rcynic_cert(cert, obj):
else:
obj.asns.add(q[0])
+ # obj.issuer is None the first time we process the root cert in the
+ # hierarchy, so we need to guard against dereference
for cls, addr_obj, addrset, parentset in (
models.AddressRange, obj.addresses, cert.resources.v4,
- obj.issuer.addresses
+ obj.issuer.addresses.all() if obj.issuer else []
), (
models.AddressRangeV6, obj.addresses_v6, cert.resources.v6,
- obj.issuer.addresses_v6
+ obj.issuer.addresses_v6.all() if obj.issuer else []
):
if addrset.inherit:
- addr_obj.add(*parentset.all())
+ addr_obj.add(*parentset)
else:
for rng in addrset:
logger.debug('processing %s' % rng)