aboutsummaryrefslogtreecommitdiff
path: root/rpkid/rpki/irdb/zookeeper.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2013-04-18 23:30:56 +0000
committerRob Austein <sra@hactrn.net>2013-04-18 23:30:56 +0000
commitde186b4393ce25cdfb51b1c3240e0326c85890cf (patch)
tree619ac6176b1dd05fe528d41cc26d15a6307cd9f0 /rpkid/rpki/irdb/zookeeper.py
parent89506621cfbb5f539fd93ca0c0250a785bd5f143 (diff)
Teach rpkic and yamltest about Ghostbusters records.
svn path=/trunk/; revision=5300
Diffstat (limited to 'rpkid/rpki/irdb/zookeeper.py')
-rw-r--r--rpkid/rpki/irdb/zookeeper.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/rpkid/rpki/irdb/zookeeper.py b/rpkid/rpki/irdb/zookeeper.py
index bd32caf1..6b72a8a8 100644
--- a/rpkid/rpki/irdb/zookeeper.py
+++ b/rpkid/rpki/irdb/zookeeper.py
@@ -918,6 +918,27 @@ class Zookeeper(object):
max_prefixlen = int(p.max_prefixlen))
+ @django.db.transaction.commit_on_success
+ def load_ghostbuster_requests(self, filename, parent = None):
+ """
+ Whack IRDB to match ghostbusters.vcard.
+
+ This accepts one or more vCards from a file.
+ """
+
+ self.resource_ca.ghostbuster_requests.filter(parent = parent).delete()
+
+ vcard = []
+
+ for line in open(filename, "r"):
+ if not vcard and not line.upper().startswith("BEGIN:VCARD"):
+ continue
+ vcard.append(line)
+ if line.upper().startswith("END:VCARD"):
+ self.resource_ca.ghostbuster_requests.create(vcard = "".join(vcard), parent = parent)
+ vcard = []
+
+
def call_rpkid(self, *pdus):
"""
Issue a call to rpkid, return result.