summaryrefslogtreecommitdiff
path: root/tools/compileconfig.py
diff options
context:
space:
mode:
authorMagnus Ahltorp <map@kth.se>2017-02-02 16:08:24 +0100
committerMagnus Ahltorp <map@kth.se>2017-02-02 21:58:38 +0100
commit8a1f3a5f5b1458aceb7567add95e7637e9c2e5fc (patch)
tree188f039cce63266dbe0dcca0477ca63bc983e74d /tools/compileconfig.py
parentf481bd4f30a00fa3d4a5b4aecd0f881b1f5b58f5 (diff)
Added tools for getting and generating global config
Diffstat (limited to 'tools/compileconfig.py')
-rwxr-xr-xtools/compileconfig.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/compileconfig.py b/tools/compileconfig.py
index 47fd19a..abe59a3 100755
--- a/tools/compileconfig.py
+++ b/tools/compileconfig.py
@@ -404,6 +404,7 @@ def gen_config(nodename, config, localconfig):
(Symbol("allowed_clients"), list(allowed_clients)),
(Symbol("allowed_servers"), list(allowed_servers)),
(Symbol("apikeys"), apikeys),
+ (Symbol("version"), config["version"]),
]
erlangconfig = [
@@ -445,12 +446,21 @@ def gen_testmakefile(config, testmakefile, machines, shellvars=False):
configfile.close()
+def printnodenames(config):
+ frontendnodenames = set([node["name"] for node in config["frontendnodes"]])
+ storagenodenames = set([node["name"] for node in config["storagenodes"]])
+ signingnodenames = set([node["name"] for node in config["signingnodes"]])
+ mergenodenames = set([node["name"] for node in config["mergenodes"]])
+
+ print " ".join(frontendnodenames|storagenodenames|signingnodenames|mergenodenames)
+
def main():
parser = argparse.ArgumentParser(description="")
parser.add_argument('--config', help="System configuration", required=True)
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")
parser.add_argument("--machines", type=int, metavar="n", help="Number of machines")
args = parser.parse_args()
@@ -460,6 +470,9 @@ def main():
elif args.testshellvars and args.machines:
config = readconfig.read_config(args.config)
gen_testmakefile(config, args.testshellvars, args.machines, shellvars=True)
+ elif args.getnodenames:
+ config = readconfig.read_config(args.config)
+ printnodenames(config)
elif args.localconfig:
localconfig = readconfig.read_config(args.localconfig)
config = readconfig.verify_and_read_config(args.config, localconfig["logadminkey"])