aboutsummaryrefslogtreecommitdiff
path: root/scripts/rpki/left_right.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2007-11-13 20:22:57 +0000
committerRob Austein <sra@hactrn.net>2007-11-13 20:22:57 +0000
commit222dcc75375bed4627b1bb66c449cb78a2588771 (patch)
tree40949241c9b752b80704e75af04354db6444543e /scripts/rpki/left_right.py
parente40bf7a235cd7e1a644c8b90d9c268ace845babe (diff)
Replace horrible profusion of tuples of resource sets with a new
wrapper abstraction. svn path=/scripts/biz-certs/Bob-CA.srl; revision=1281
Diffstat (limited to 'scripts/rpki/left_right.py')
-rw-r--r--scripts/rpki/left_right.py23
1 files changed, 11 insertions, 12 deletions
diff --git a/scripts/rpki/left_right.py b/scripts/rpki/left_right.py
index 3979931b..3528152d 100644
--- a/scripts/rpki/left_right.py
+++ b/scripts/rpki/left_right.py
@@ -729,17 +729,14 @@ class sax_handler(rpki.sax_utils.handler):
return self.pdu()
def irdb_query(gctx, self_id, child_id = None):
- """Perform an IRDB callback query.
-
- In the long run this should not be a blocking routine, it should
- instead issue a query and set up a handler to receive the response.
- For the moment, though, we're doing simple lock step and damn the
- torpedos.
-
- Not yet doing anything useful with validity interval or subject
- name. Most likely this function should really be wrapped up in a
- class that carries both the query result and also the intermediate state
- needed for the event-driven code that this function will need to become.
+ """Perform an IRDB callback query. In the long run this should not
+ be a blocking routine, it should instead issue a query and set up a
+ handler to receive the response. For the moment, though, we are
+ doing simple lock step and damn the torpedos. Not yet doing
+ anything useful with validity interval or subject name. Most likely
+ this function should really be wrapped up in a class that carries
+ both the query result and also the intermediate state needed for the
+ event-driven code that this function will need to become.
"""
q_msg = msg()
@@ -760,4 +757,6 @@ def irdb_query(gctx, self_id, child_id = None):
r_msg = rpki.left_right.sax_handler.saxify(r_elt)
if len(r_msg) == 0 or not isinstance(r_msg[0], list_resources_elt) or r_msg[0].type != "reply":
raise rpki.exceptions.BadIRDBReply, "Unexpected response to IRDB query: %s" % r_msg.toXML()
- return r_msg[0].as, r_msg[0].ipv4, r_msg[0].ipv6
+ return rpki.resource_set.resource_bag(r_msg[0].as,
+ r_msg[0].ipv4,
+ r_msg[0].ipv6)