diff options
author | Rob Austein <sra@hactrn.net> | 2009-06-04 18:30:40 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2009-06-04 18:30:40 +0000 |
commit | 467e7a98fea439040bd7451d67f188d334427103 (patch) | |
tree | df9f247cb543a6e390ec38989b70ab864cc0748d /rpkid/irdbd.py | |
parent | b0bdcca2ed05b0b0e5657623150b59cf5df305be (diff) |
Rototill left-right and publication protocol to replace SQL-assigned
numeric identifiers with IRBE-assigned "handles". Daemons and test
harness have been converted and seem to work; some tools like irbe_cli
haven't been updated yet.
svn path=/rpkid/doc/Installation; revision=2493
Diffstat (limited to 'rpkid/irdbd.py')
-rwxr-xr-x | rpkid/irdbd.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/rpkid/irdbd.py b/rpkid/irdbd.py index 8f86aa38..d272c683 100755 --- a/rpkid/irdbd.py +++ b/rpkid/irdbd.py @@ -61,22 +61,21 @@ def handler(query, path, cb): r_pdu = rpki.left_right.list_resources_elt() r_pdu.tag = q_pdu.tag - r_pdu.self_id = q_pdu.self_id - r_pdu.child_id = q_pdu.child_id + r_pdu.self_handle = q_pdu.self_handle + r_pdu.child_handle = q_pdu.child_handle cur.execute( """ - SELECT registrant_id, registrant_handle, valid_until FROM registrant - WHERE registrant.rpki_self_id = %s AND registrant.rpki_child_id = %s + SELECT registrant_id, valid_until FROM registrant + WHERE registrant.rpki_self_handle = %s AND registrant.registrant_handle = %s """, - (q_pdu.self_id, q_pdu.child_id)) + (q_pdu.self_handle, q_pdu.child_handle)) if cur.rowcount != 1: raise rpki.exceptions.NotInDatabase, \ - "This query should have produced a single exact match, something's messed up (rowcount = %d, self_id = %s, child_id = %s)" \ - % (cur.rowcount, q_pdu.self_id, q_pdu.child_id) + "This query should have produced a single exact match, something's messed up (rowcount = %d, self_handle = %s, child_handle = %s)" \ + % (cur.rowcount, q_pdu.self_handle, q_pdu.child_handle) - registrant_id, registrant_handle, valid_until = cur.fetchone() - #r_pdu.registrant_handle = registrant_handle + registrant_id, valid_until = cur.fetchone() r_pdu.valid_until = valid_until.strftime("%Y-%m-%dT%H:%M:%SZ") r_pdu.asn = rpki.resource_set.resource_set_as.from_sql(cur, "SELECT start_as, end_as FROM asn WHERE registrant_id = %s", (registrant_id,)) r_pdu.ipv4 = rpki.resource_set.resource_set_ipv4.from_sql(cur, "SELECT start_ip, end_ip FROM net WHERE registrant_id = %s AND version = 4", (registrant_id,)) @@ -84,7 +83,7 @@ def handler(query, path, cb): except Exception, data: rpki.log.error(traceback.format_exc()) - r_pdu = rpki.left_right.report_error_elt.from_exception(data, q_pdu.self_id) + r_pdu = rpki.left_right.report_error_elt.from_exception(data, q_pdu.self_handle) r_msg.append(r_pdu) |