From: Jan Fajerski Date: Fri, 27 Apr 2018 13:36:11 +0000 (+0200) Subject: pybing/mgr/prometheus: return default port if config-key get returns empty X-Git-Tag: v13.1.0~23^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F21696%2Fhead;p=ceph.git pybing/mgr/prometheus: return default port if config-key get returns empty Signed-off-by: Jan Fajerski --- diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index ce34defd4a10..576b8bf305e9 100644 --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@ -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))