diff options
author | Rob Austein <sra@hactrn.net> | 2013-04-18 23:30:56 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2013-04-18 23:30:56 +0000 |
commit | de186b4393ce25cdfb51b1c3240e0326c85890cf (patch) | |
tree | 619ac6176b1dd05fe528d41cc26d15a6307cd9f0 /rpkid/rpki/irdb | |
parent | 89506621cfbb5f539fd93ca0c0250a785bd5f143 (diff) |
Teach rpkic and yamltest about Ghostbusters records.
svn path=/trunk/; revision=5300
Diffstat (limited to 'rpkid/rpki/irdb')
-rw-r--r-- | rpkid/rpki/irdb/zookeeper.py | 21 |
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. |