From: Patrick Seidensal Date: Wed, 6 Nov 2019 10:45:51 +0000 (+0100) Subject: mgr/prometheus: return FQDN for default server_addr X-Git-Tag: v14.2.5~87^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=8b2a50bf076c5bf9839a49d0e6672982df6accb5;p=ceph.git mgr/prometheus: return FQDN for default server_addr 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 (cherry picked from commit 9eb1c34f6fcbf5ac7e1e0b695a0182d5937cc038) --- diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index f1c9370300555..afe247f8d9757 100644 --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@ -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 ))