Commit 3c25e1cc authored by Paul Graydon's avatar Paul Graydon

software/wendelin-telecom: Improve ORS registration process

parent 4d3b16f4
...@@ -4,4 +4,4 @@ md5sum = 79e4a9d4c632eaf0472929464a12e768 ...@@ -4,4 +4,4 @@ md5sum = 79e4a9d4c632eaf0472929464a12e768
[template-wendelin-telecom] [template-wendelin-telecom]
filename = instance-wendelin-telecom.cfg.in filename = instance-wendelin-telecom.cfg.in
md5sum = f52ac49e933d6144aa319f2525d14108 md5sum = d9985b678497614b8ee2c6ac5e62a04d
...@@ -64,14 +64,18 @@ update = ...@@ -64,14 +64,18 @@ update =
response = requests.get(request_url, verify=False, auth=(inituser_login, inituser_password)) response = requests.get(request_url, verify=False, auth=(inituser_login, inituser_password))
response = response.json() response = response.json()
error_msg_key = "error_msg" status = response['status']
if error_msg_key in response: message = response['message']
error_msg = response[error_msg_key] message = "%s: %s" % (slave_reference, message)
log.info(error_msg)
if status == 'ok':
log.info(message)
log.info("%s: Update connection parameters" % slave_reference)
computer_partition.setConnectionDict({'gateway-host': str(fluentd_gateway_host)}, slave_reference)
elif status == 'error':
log.fatal(message)
else: else:
log.info("ORS successfully registered: %s" % slave_reference) log.fatal("Unexpected status received during ORS registration: %s" % status)
log.info("Update parameters for %s" % slave_reference)
computer_partition.setConnectionDict({'gateway-host': str(fluentd_gateway_host)}, slave_reference),
[publish] [publish]
slave-amount = {{ len(slave_instance_list) }} slave-amount = {{ len(slave_instance_list) }}
...@@ -34,7 +34,7 @@ depends = ...@@ -34,7 +34,7 @@ depends =
<= erp5 <= erp5
repository = https://lab.nexedi.com/paul.graydon/wendelin-telecom.git repository = https://lab.nexedi.com/paul.graydon/wendelin-telecom.git
branch = master branch = master
revision = c53925b189a4721fd99d7609fd589510ee3b318e revision = cf86671615a8f7a4a31e971112ea726633b4e5e3
[local-bt5-repository] [local-bt5-repository]
list += ${wendelin-telecom:location}/bt5 list += ${wendelin-telecom:location}/bt5
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment