pybing/mgr/prometheus: return default port if config-key get returns empty

Signed-off-by: Jan Fajerski <jfajerski@suse.com>
This commit is contained in:
Jan Fajerski 2018-04-27 15:36:11 +02:00
parent 9360f76410
commit c7456a4ecf

View File

@ -593,6 +593,7 @@ class Module(MgrModule):
r, outb, outs = result.wait()
if r != 0:
global_instance().log.error("Failed to retrieve port for mgr {}: {}".format(id_, outs))
targets.append('{}:{}'.format(hostname, DEFAULT_PORT))
else:
port = json.loads(outb)
targets.append('{}:{}'.format(hostname, port))