diff options
author | Rob Austein <sra@hactrn.net> | 2010-03-10 21:07:27 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2010-03-10 21:07:27 +0000 |
commit | bebec498d4c02306f50b1e52951377d3b97e1179 (patch) | |
tree | a14c85f79ffcba32a58a9e95e4d2b4f84a5b8754 /myrpki.rototill | |
parent | af0b11ff47fbeb93c56a1090c79fe4e71a4cd306 (diff) |
One more try at getting new <myrpki/> service_uri attribute right
svn path=/myrpki.rototill/myrpki.py; revision=3069
Diffstat (limited to 'myrpki.rototill')
-rw-r--r-- | myrpki.rototill/myrpki.py | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/myrpki.rototill/myrpki.py b/myrpki.rototill/myrpki.py index 019a1946..1ca51058 100644 --- a/myrpki.rototill/myrpki.py +++ b/myrpki.rototill/myrpki.py @@ -939,22 +939,24 @@ class main(rpki.cli.Cmd): try: e = etree_read(self.cfg.get("xml_filename")) - service_uri = "%s/%s" % (e.get("service_uri"), child_handle) + service_uri_base = e.get("service_uri") except IOError: - if self.run_rpkid: - service_uri = "https://%s:%s/up-down/%s/%s" % (self.cfg.get("rpkid_server_host"), + service_uri_base = None + + if not service_uri_base and self.run_rpkid: + service_uri_base = "https://%s:%s/up-down/%s" % (self.cfg.get("rpkid_server_host"), self.cfg.get("rpkid_server_port"), - self.handle, child_handle) - else: - print "Sorry, you can't set up children of a hosted config that itself has not yet been set up" - return + self.handle) + if not service_uri_base: + print "Sorry, you can't set up children of a hosted config that itself has not yet been set up" + return print "Child calls itself %r, we call it %r" % (c.get("handle"), child_handle) self.bpki_servers.fxcert(c.findtext("bpki_ta")) e = Element("parent", parent_handle = self.handle, child_handle = child_handle, - service_uri = service_uri, + service_uri = "%s/%s" % (service_uri_base, child_handle), valid_until = str(rpki.sundial.now() + rpki.sundial.timedelta(days = 365))) PEMElement(e, "bpki_resource_ta", self.bpki_resources.cer) @@ -1569,7 +1571,7 @@ class main(rpki.cli.Cmd): if bsc_req is not None: SubElement(tree, "bpki_bsc_pkcs10").text = bsc_req.get_Base64() - tree.set("service_uri", rpkid_base + "up-down/" + self.handle) + tree.set("service_uri", rpkid_base + "up-down/" + handle) e = tree.find("bpki_server_ta") if e is not None: |