diff options
author | Rob Austein <sra@hactrn.net> | 2009-07-16 05:32:33 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2009-07-16 05:32:33 +0000 |
commit | 9c7e9583f6cb04eb2df0e4c9a1eb33fb1e9c60c2 (patch) | |
tree | 76ae04628968a45058da56cf18242b117be1ad8d | |
parent | 64f1408a91677b62dfb6ce7cdcec279b30eb3d68 (diff) |
Generated config now works, mostly. Portions still very kludgy.
svn path=/myrpki/yamltest.py; revision=2628
-rw-r--r-- | myrpki/yamltest.py | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/myrpki/yamltest.py b/myrpki/yamltest.py index 09653511..09612a55 100644 --- a/myrpki/yamltest.py +++ b/myrpki/yamltest.py @@ -259,26 +259,24 @@ class allocation(object): def dump_conf(self, fn): - replacements = { ("myrpki", "handle"): self.name } + r = { ("myrpki", "handle") : self.name } if not self.is_hosted(): - replacements.update({ - ("myirbe", "rsync_base"): "rsync://localhost:%d/" % self.rsync_port, - ("myirbe", "pubd_base"): "https://localhost:%d/" % self.pubd_port, - ("myirbe", "rpkid_base"): "https://localhost:%d/" % self.rpkid_port, - ("myirbe", "irdbd_conf"): "myrpki.conf", - ("irdbd", "sql-database"): "irdb%d" % self.engine, - ("rpkid", "sql-database"): "rpki%d" % self.engine, - ("pubd", "sql-database"): "pubd%d" % self.engine, - ("irdbd", "https-url"): "https://localhost:%d/" % self.irdbd_port, - ("rpkid", "irdb-url"): "https://localhost:%d/" % self.irdbd_port, - ("rpkid", "server-port"): "%d" % self.rpkid_port, - ("pubd", "server-port"): "%d" % self.pubd_port, - ("rootd", "server-port"): "%d" % (self.rootd_port if self.is_root() else 0) }) + r["irdbd", "https-url"] = "https://localhost:%d/" % self.irdbd_port + r["irdbd", "sql-database"] = "irdb%d" % self.engine + r["myirbe", "irdbd_conf"] = "myrpki.conf" + r["myirbe", "pubd_base"] = "https://localhost:%d/" % self.pubd_port + r["myirbe", "rpkid_base"] = "https://localhost:%d/" % self.rpkid_port + r["myirbe", "rsync_base"] = "rsync://localhost:%d/" % self.rsync_port + r["pubd", "server-port"] = "%d" % self.pubd_port + r["pubd", "sql-database"] = "pubd%d" % self.engine + r["rpkid", "irdb-url"] = "https://localhost:%d/" % self.irdbd_port + r["rpkid", "server-port"] = "%d" % self.rpkid_port + r["rpkid", "sql-database"] = "rpki%d" % self.engine if self.is_root(): - replacements.update({ - ("rootd", "server-port"): "%d" % self.rootd_port }) + r["rootd", "rpki-root-dir"] = "publication/localhost:%d/" % self.rsync_port + r["rootd", "server-port"] = "%d" % self.rootd_port f = self.outfile(fn) f.write("# Automatically generated, do not edit\n") @@ -293,8 +291,8 @@ class allocation(object): continue m = variable_regexp.match(line) if m is None else None variable = m.group(1) if m else None - if (section, variable) in replacements: - line = variable + " = " + replacements[(section, variable)] + "\n" + if (section, variable) in r: + line = variable + " = " + r[section, variable] + "\n" f.write(line) f.close() @@ -395,6 +393,8 @@ rootd_openssl("x509", "-req", "-sha256", "-outform", "DER", "-extfile", "myrpki.conf", "-extensions", "rpki_x509_extensions") +os.makedirs(db.root.path("publication/localhost:%d" % db.root.rsync_port)) + # At this point we need to start a whole lotta daemons. progs = [] |