summaryrefslogtreecommitdiff
path: root/tools/compileconfig.py
diff options
context:
space:
mode:
authorMagnus Ahltorp <map@kth.se>2017-03-02 12:49:18 +0100
committerLinus Nordberg <linus@nordu.net>2017-03-15 17:45:32 +0100
commit8e4cd93fd1ab8fa148256633f3eb261a5bd1d311 (patch)
treee1bcb12360dcbd265fbe2f4f48ef0fa02c9cb3fd /tools/compileconfig.py
parent2b9e8c620006705a9459a61c88c7c0cd8fb02212 (diff)
Rename to statusserver
Diffstat (limited to 'tools/compileconfig.py')
-rwxr-xr-xtools/compileconfig.py48
1 files changed, 24 insertions, 24 deletions
diff --git a/tools/compileconfig.py b/tools/compileconfig.py
index c5ad00c..44db767 100755
--- a/tools/compileconfig.py
+++ b/tools/compileconfig.py
@@ -74,7 +74,7 @@ def parse_address(address):
def get_node_config(nodename, config):
nodetype = []
nodeconfig = {}
- for t in ["frontendnodes", "storagenodes", "signingnodes", "mergenodes", "statsservers"]:
+ for t in ["frontendnodes", "storagenodes", "signingnodes", "mergenodes", "statusservers"]:
for node in config[t]:
if node["name"] == nodename:
nodetype.append(t)
@@ -125,22 +125,22 @@ def gen_http_servers(nodetype, nodeconfig, bind_addresses, bind_publicaddress, b
if "mergenodes" in nodetype:
(host, port) = get_address(bind_addresses["merge"], nodeconfig["mergenodes"])
https_servers.append((Symbol("frontend_https_api"), host, port, Symbol("frontend")))
- if "statsservers" in nodetype:
- (host, port) = get_address(None, nodeconfig["statsservers"])
- https_servers.append((Symbol("statsserver_https_api"), host, port, Symbol("statsserver")))
+ if "statusservers" in nodetype:
+ (host, port) = get_address(None, nodeconfig["statusservers"])
+ https_servers.append((Symbol("statusserver_https_api"), host, port, Symbol("statusserver")))
if bind_publicaddress:
(publichost, publicport) = parse_address(bind_publicaddress)
else:
- (_, publicport) = parse_address(nodeconfig["statsservers"]["publicaddress"])
+ (_, publicport) = parse_address(nodeconfig["statusservers"]["publicaddress"])
publichost = "0.0.0.0"
if bind_publichttpaddress:
(publichttphost, publichttpport) = parse_address(bind_publichttpaddress)
- http_servers.append((Symbol("external_http_api"), publichttphost, publichttpport, Symbol("statsserver")))
- https_servers.append((Symbol("external_https_api"), publichost, publicport, Symbol("statsserver")))
+ http_servers.append((Symbol("external_http_api"), publichttphost, publichttpport, Symbol("statusserver")))
+ https_servers.append((Symbol("external_https_api"), publichost, publicport, Symbol("statusserver")))
- if nodetype - set(["frontendnodes", "storagenodes", "signingnodes", "mergenodes", "statsservers"]):
+ if nodetype - set(["frontendnodes", "storagenodes", "signingnodes", "mergenodes", "statusservers"]):
print >>sys.stderr, "unknown nodetype", nodetype
sys.exit(1)
@@ -284,7 +284,7 @@ def gen_config(nodename, config, localconfig):
(Symbol("https_keyfile"), paths["https_keyfile"]),
]
- if "statsservers" in nodetype:
+ if "statusservers" in nodetype:
plopconfig += [
(Symbol("https_servers"), https_servers),
(Symbol("http_servers"), http_servers),
@@ -363,8 +363,8 @@ def gen_config(nodename, config, localconfig):
storagenodeaddresses = ["https://%s/plop/v1/storage/" % node["address"] for node in config["storagenodes"]]
frontendnodenames = [node["name"] for node in config["frontendnodes"]]
frontendnodeaddresses = ["https://%s/plop/v1/frontend/" % node["address"] for node in config["frontendnodes"]]
- statsservernames = [node["name"] for node in config["statsservers"]]
- statsserveraddresses = ["https://%s/plop/v1/status/" % node["address"] for node in config["statsservers"]]
+ statusservernames = [node["name"] for node in config["statusservers"]]
+ statusserveraddresses = ["https://%s/plop/v1/status/" % node["address"] for node in config["statusservers"]]
allowed_clients = []
allowed_servers = []
@@ -437,17 +437,17 @@ def gen_config(nodename, config, localconfig):
(Symbol("plopcontrol"), plopcontrolfilename),
]
- reloadableplopconfig.append((Symbol("statsservers"), statsserveraddresses))
+ reloadableplopconfig.append((Symbol("statusservers"), statusserveraddresses))
allowed_servers += [
- ("/plop/v1/status/merge_dist", statsservernames),
- ("/plop/v1/status/merge_backup", statsservernames),
- ("/plop/v1/status/merge_sth", statsservernames),
- ("/plop/v1/status/merge_fetch", statsservernames),
- ("/plop/v1/status/storage", statsservernames),
- ("/plop/v1/status/merge_errors", statsservernames),
+ ("/plop/v1/status/merge_dist", statusservernames),
+ ("/plop/v1/status/merge_backup", statusservernames),
+ ("/plop/v1/status/merge_sth", statusservernames),
+ ("/plop/v1/status/merge_fetch", statusservernames),
+ ("/plop/v1/status/storage", statusservernames),
+ ("/plop/v1/status/merge_errors", statusservernames),
]
- if "statsservers" in nodetype:
+ if "statusservers" in nodetype:
allowed_clients += [
("/plop/v1/status/merge_dist", mergenodenames),
("/plop/v1/status/merge_backup", mergenodenames),
@@ -509,12 +509,12 @@ def gen_testmakefile(config, testmakefile, shellvars=False):
signingnodenames = set([node["name"] for node in config["signingnodes"]])
mergenodenames = set([node["name"] for node in config["mergenodes"]])
mergesecondarynodenames = set([node["name"] for node in config["mergenodes"] if node["name"] != config["primarymergenode"]])
- statsservernodenames = set([node["name"] for node in config.get("statsservers")])
+ statusservernodenames = set([node["name"] for node in config.get("statusservers")])
frontendnodenames_except_last = sorted(frontendnodenames)[:-1]
frontendnodenames_except_first = sorted(frontendnodenames)[1:]
- allnodes = config["frontendnodes"] + config["storagenodes"] + config["signingnodes"] + config["mergenodes"] + config["statsservers"]
+ allnodes = config["frontendnodes"] + config["storagenodes"] + config["signingnodes"] + config["mergenodes"] + config["statusservers"]
testaddresses = multivaldict([(node["name"], node["address"]) for node in allnodes])
@@ -527,7 +527,7 @@ def gen_testmakefile(config, testmakefile, shellvars=False):
print_nodevar(configfile, delimiter, "SIGNING", "catlfish", signingnodenames, testaddresses)
print_nodevar(configfile, delimiter, "MERGESECONDARY", "catlfish", mergesecondarynodenames, testaddresses)
print_nodevar(configfile, delimiter, "MERGEPRIMARY", "merge", [config["primarymergenode"]], testaddresses, gentesturl=False)
- print_nodevar(configfile, delimiter, "STATSSERVER", "statsserver", statsservernodenames, testaddresses)
+ print_nodevar(configfile, delimiter, "STATUSSERVER", "statusserver", statusservernodenames, testaddresses)
print >>configfile, "NODES=" + delimiter + " ".join(set([node["name"] for node in allnodes])) + delimiter
@@ -541,9 +541,9 @@ def printnodenames(config):
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"]])
- statsservernodenames = set([node["name"] for node in config.get("statsservers")])
+ statusservernodenames = set([node["name"] for node in config.get("statusservers")])
- print " ".join(frontendnodenames|storagenodenames|signingnodenames|mergenodenames|statsservernodenames)
+ print " ".join(frontendnodenames|storagenodenames|signingnodenames|mergenodenames|statusservernodenames)
def main():
parser = argparse.ArgumentParser(description="")