]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/prometheus: return FQDN for default server_addr 31482/head
authorPatrick Seidensal <pseidensal@suse.com>
Wed, 6 Nov 2019 10:45:51 +0000 (11:45 +0100)
committerLaura Paduano <lpaduano@suse.com>
Fri, 8 Nov 2019 09:19:16 +0000 (10:19 +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>
(cherry picked from commit 9eb1c34f6fcbf5ac7e1e0b695a0182d5937cc038)

src/pybind/mgr/prometheus/module.py

index f1c9370300555ba43207155e91e2abdd213d4ec0..afe247f8d9757cca79ffea2885ba1d629384acc3 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
         ))