From 21e8c4bc5c12be2e73f9eff5a9045ddbe5c52912 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Sat, 22 Dec 2007 15:35:15 +0000 Subject: Doh, helps to put the foreign keys into the IRDB. svn path=/scripts/testdb.py; revision=1418 --- scripts/testdb.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts/testdb.py') diff --git a/scripts/testdb.py b/scripts/testdb.py index 8148ca65..d8f3a146 100644 --- a/scripts/testdb.py +++ b/scripts/testdb.py @@ -375,8 +375,12 @@ class allocation(object): cms_ta = self.parent.rpkid_ta, https_ta = self.parent.rpkid_ta, sender_name = self.name, recipient_name = self.parent.name, peer_contact_uri = "https://localhost:%s/up-down/%s" % (self.parent.rpki_port, self.child_id))).parent_id + db = MySQLdb.connect(user = "irdb", db = self.irdb_db_name, passwd = irdb_db_pass) + cur = db.cursor() for kid in self.kids: kid.child_id = self.call_rpkid(rpki.left_right.child_elt.make_pdu(action = "create", self_id = self.self_id, bsc_id = self.bsc_id, cms_ta = kid.rpkid_ta)).child_id + cur.execute("UPDATE registrant SET rpki_self_id = %s, rpki_child_id = %s WHERE IRBE_mapped_id = %s", (self.self_id, kid.child_id, kid.name)) + db.close() def write_leaf_yaml(self): """Write YAML scripts for leaf nodes. Only supports list requests -- cgit v1.2.3