]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/prometheus: return FQDN for default server_addr
authorPatrick Seidensal <pseidensal@suse.com>
Wed, 6 Nov 2019 10:45:51 +0000 (11:45 +0100)
committerPatrick Seidensal <pseidensal@suse.com>
Wed, 6 Nov 2019 13:58:21 +0000 (14:58 +0100)
Instead of returning '0.0.0.0' the prometheus module returns the FQDN of
the host, as it is the case for '::'.

Fixes: https://tracker.ceph.com/issues/42664
Signed-off-by: Patrick Seidensal <pseidensal@suse.com>
src/pybind/mgr/prometheus/module.py

index 9aa7ba6421597873efa43dbe4d2f00250f97787c..62e809ac95dd6e283ebd2f97f9df7f3f7955f105 100644 (file)
@@ -1087,7 +1087,7 @@ class Module(MgrModule):
         # Publish the URI that others may use to access the service we're
         # about to start serving
         self.set_uri('http://{0}:{1}/'.format(
-            socket.getfqdn() if server_addr == '::' else server_addr,
+            socket.getfqdn() if server_addr in ['::', '0.0.0.0'] else server_addr,
             server_port
         ))