diff options
author | Magnus Ahltorp <map@kth.se> | 2017-06-30 10:48:21 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordu.net> | 2017-07-06 17:48:30 +0200 |
commit | 4e44c1e8a4ea6ec4c5eeb2a1a05d93e076c7fd50 (patch) | |
tree | d4a6945f3399324e4db99673449c425ebd9e3c78 /tools/compileconfig.py | |
parent | bb71cbabaac8baf18f7a685339f0e2670b019d91 (diff) |
Replace 'localnodes' config with 'nodename'
Also some cleanup
Diffstat (limited to 'tools/compileconfig.py')
-rwxr-xr-x | tools/compileconfig.py | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/tools/compileconfig.py b/tools/compileconfig.py index e233cc7..94e0b51 100755 --- a/tools/compileconfig.py +++ b/tools/compileconfig.py @@ -240,13 +240,13 @@ def gen_config(nodename, config, localconfig): paths = localconfig["paths"] apikeys = api_keys(config) bind_addresses = { - "frontend": localconfig.get("frontendaddresses", {}).get(nodename), - "storage": localconfig.get("storageaddresses", {}).get(nodename), - "signing": localconfig.get("signingaddresses", {}).get(nodename), - "merge": localconfig.get("mergeaddresses", {}).get(nodename), + "frontend": localconfig.get("frontendaddress"), + "storage": localconfig.get("storageaddress"), + "signing": localconfig.get("signingaddress"), + "merge": localconfig.get("mergeaddress"), } - bind_publicaddress = localconfig.get("ctapiaddresses", {}).get(nodename) - bind_publichttpaddress = localconfig.get("publichttpaddresses", {}).get(nodename) + bind_publicaddress = localconfig.get("ctapiaddress") + bind_publichttpaddress = localconfig.get("publichttpaddress") options = localconfig.get("options", []) configfile = open(paths["configdir"] + "/" + nodename + ".config", "w") @@ -270,7 +270,7 @@ def gen_config(nodename, config, localconfig): reloadableplopconfig = [] if nodetype & set(["frontendnodes", "mergenodes"]): - catlfishconfig.append((Symbol("known_roots_path"), localconfig["paths"]["knownroots"])) + catlfishconfig.append((Symbol("known_roots_path"), paths["knownroots"])) if "frontendnodes" in nodetype: plopconfig.append((Symbol("sptcache_root_path"), paths["db"] + "sctcache")) if "ratelimits" in localconfig: @@ -320,9 +320,6 @@ def gen_config(nodename, config, localconfig): plopconfig += [ (Symbol("fsync_parallel_tasks"), 4), ] - if dbbackend == "permdb" and len(localconfig["localnodes"]) != 1: - print >>sys.stderr, "When using permdb, all services have to be in the same node" - sys.exit(1) #print "nodetype", ", ".join(nodetype) if nodetype & set(["frontendnodes", "storagenodes"]): @@ -566,13 +563,17 @@ def printnodenames(config): def main(): parser = argparse.ArgumentParser(description="") - parser.add_argument('--config', help="System configuration", required=True) + parser.add_argument('--config', help="System configuration") parser.add_argument('--localconfig', help="Local configuration") parser.add_argument("--testmakefile", metavar="file", help="Generate makefile variables for test") parser.add_argument("--testshellvars", metavar="file", help="Generate shell variable file for test") parser.add_argument("--getnodenames", action='store_true', help="Get list of node names") args = parser.parse_args() + if not args.config: + print >>sys.stderr, "--config is required" + sys.exit(1) + if args.testmakefile: config = readconfig.read_config(args.config) gen_testmakefile(config, args.testmakefile) @@ -586,9 +587,7 @@ def main(): localconfig = readconfig.read_config(args.localconfig) config = readconfig.verify_and_read_config(args.config, localconfig["logadminkey"]) - localnodes = localconfig["localnodes"] - for localnode in localnodes: - gen_config(localnode, config, localconfig) + gen_config(localconfig["nodename"], config, localconfig) else: print >>sys.stderr, "Nothing to do" sys.exit(1) |