aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Elkins <melkins@tislabs.com>2012-01-19 01:34:32 +0000
committerMichael Elkins <melkins@tislabs.com>2012-01-19 01:34:32 +0000
commit675d141d630152b10cd0b9364618b286ba9b9d84 (patch)
treecb10a1263de9194d0f420b3399df0b2855294573
parentedf891be7ebaf36182d27ad73a9e29e9ab4109d8 (diff)
use create() instead of add() when constructing a new object rather than adding an existing object
fields for prefixes are prefix_min and prefix_max, not min and max svn path=/branches/tk161/; revision=4227
-rw-r--r--rpkid/rpki/gui/app/glue.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/rpkid/rpki/gui/app/glue.py b/rpkid/rpki/gui/app/glue.py
index fc6c2f31..079c844d 100644
--- a/rpkid/rpki/gui/app/glue.py
+++ b/rpkid/rpki/gui/app/glue.py
@@ -189,7 +189,7 @@ def list_received_resources(log, conf):
for pdu in pdus:
if isinstance(pdu, rpki.left_right.list_received_resources_elt):
- parent = models.Parent.get(issuer=conf, handle=pdu.parent_handle)
+ parent = models.Parent.objects.get(issuer=conf, handle=pdu.parent_handle)
not_before = datetime.strptime(pdu.notBefore, "%Y-%m-%dT%H:%M:%SZ")
not_after = datetime.strptime(pdu.notAfter, "%Y-%m-%dT%H:%M:%SZ")
@@ -197,13 +197,14 @@ def list_received_resources(log, conf):
cert = models.ResourceCert.objects.create(parent=parent, not_before=not_before, not_after=not_after)
for asn in rpki.resource_set.resource_set_as(pdu.asn):
- cert.asn_ranges.add(min=asn.min, max=asn.max)
+ cert.asn_ranges.create(min=asn.min, max=asn.max)
for rng in rpki.resource_set.resource_set_ipv4(pdu.ipv4):
- cert.address_ranges.add(min=rng.min, max=rng.max)
+ print >>log, 'adding v4 address range: %s' % rng
+ cert.address_ranges.create(prefix_min=rng.min, prefix_max=rng.max)
for rng in rpki.resource_set.resource_set_ipv6(pdu.ipv6):
- cert.address_ranges_v6.add(min=rng.min, max=rng.max)
+ cert.address_ranges_v6.create(prefix_min=rng.min, prefix_max=rng.max)
else:
print >>log, "error: unexpected pdu from rpkid type=%s" % type(pdu)