aboutsummaryrefslogtreecommitdiff
path: root/rpki/irdb/zookeeper.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2016-04-23 15:03:32 +0000
committerRob Austein <sra@hactrn.net>2016-04-23 15:03:32 +0000
commitf81321b26b8112dc971288ec116aa64178dd3259 (patch)
tree8ce05d259a2ffce07fb6c585287df7291668e2b4 /rpki/irdb/zookeeper.py
parent9fbe58912e66c98ca3ad8f20abfae27b29c977d5 (diff)
Initial version of rpki.irdb.models.Root. May end up folding this
into an expanded rpki.irdb.models.Parent, as the two are more alike than I expected them to be, but archive this version first. svn path=/branches/tk705/; revision=6375
Diffstat (limited to 'rpki/irdb/zookeeper.py')
-rw-r--r--rpki/irdb/zookeeper.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/rpki/irdb/zookeeper.py b/rpki/irdb/zookeeper.py
index 5bfed98b..7446e7c7 100644
--- a/rpki/irdb/zookeeper.py
+++ b/rpki/irdb/zookeeper.py
@@ -365,8 +365,9 @@ class Zookeeper(object):
@django.db.transaction.atomic
- def configure_rootd(self):
+ def configure_root(self, handle, resources):
+ # XXX This should be some other exception, not an assertion
assert self.run_rpkid and self.run_pubd and self.run_rootd
rpki.irdb.models.Rootd.objects.get_or_certify(
@@ -374,10 +375,18 @@ class Zookeeper(object):
service_uri = "http://localhost:%s/" % self.cfg.get("rootd_server_port",
section = myrpki_section))
- return self.generate_rootd_repository_offer()
+ rpki.irdb.models.Root.objects.get_or_certify(
+ handle = handle or self.handle,
+ issuer = self.resource_ca,
+ ta = self.resource_ca.certificate,
+ asn_resources = str(resources.asn),
+ ipv4_resources = str(resources.v4),
+ ipv6_resources = str(resources.v6))
+ return self.generate_root_repository_offer()
- def generate_rootd_repository_offer(self):
+
+ def generate_root_repository_offer(self):
"""
Generate repository offer for rootd. Split out of
configure_rootd() because that's easier for the GUI.