diff options
author | Rob Austein <sra@hactrn.net> | 2009-05-20 16:56:53 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2009-05-20 16:56:53 +0000 |
commit | d4ef3fc706e2b610e18a9c52b2bf29bf538c4623 (patch) | |
tree | 810b59d453392199b4c8d0df3f708079a7010928 /rpkid/testbed.py | |
parent | d0c51c600ccea8db0c34275ac313c8e89912e643 (diff) |
Checkpoint
svn path=/rpkid/testbed.py; revision=2442
Diffstat (limited to 'rpkid/testbed.py')
-rw-r--r-- | rpkid/testbed.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/rpkid/testbed.py b/rpkid/testbed.py index 87f68f77..b3d25b6f 100644 --- a/rpkid/testbed.py +++ b/rpkid/testbed.py @@ -725,9 +725,19 @@ class allocation(object): """ Send a left-right message to this entity's RPKI daemon and return the response. + + If this entity is hosted (does not run its own RPKI daemon), all + of this happens with the hosting RPKI daemon. """ + rpki.log.info("Calling rpkid for %s" % self.name) - msg = rpki.left_right.msg([pdu]) + + if self.is_hosted(): + rpki.log.info("rpkid %s is hosted by rpkid %s, switching" % (self.name, self.hosted_by.name)) + self = self.hosted_by + assert not self.is_hosted() + + msg = rpki.left_right.msg(pdu if isinstance(pdu, (list, tuple)) else [pdu]) msg.type = "query" cms, xml = rpki.left_right.cms_msg.wrap(msg, self.irbe_key, self.irbe_cert, pretty_print = True) @@ -735,7 +745,7 @@ class allocation(object): url = "https://localhost:%d/left-right" % self.rpki_port def done(val): - rpki.log.info("Callback to rpkid %s" % self.name) + rpki.log.info("Callback from rpkid %s" % self.name) if isinstance(val, Exception): raise val msg, xml = rpki.left_right.cms_msg.unwrap(val, (self.rpkid_ta, self.rpkid_cert), @@ -755,8 +765,6 @@ class allocation(object): callback = done, errback = done) - rpki.log.info("Call to rpkid %s returned" % self.name) - def cross_certify(self, certificant, reverse = False): """ Cross-certify and return the resulting certificate. |