From: Sebastian Wagner Date: Thu, 16 Dec 2021 16:57:50 +0000 (+0100) Subject: mgr/cephadm: SNMP: don't write urls manually X-Git-Tag: v17.1.0~130^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3f47c2293b9ace730d6f76c613ef2106f274ea32;p=ceph.git mgr/cephadm: SNMP: don't write urls manually this just broken for non-trivial urls. Don't be a bad example Signed-off-by: Sebastian Wagner --- diff --git a/src/pybind/mgr/cephadm/services/monitoring.py b/src/pybind/mgr/cephadm/services/monitoring.py index c252462c212e..d67d3057bb80 100644 --- a/src/pybind/mgr/cephadm/services/monitoring.py +++ b/src/pybind/mgr/cephadm/services/monitoring.py @@ -158,7 +158,9 @@ class AlertmanagerService(CephadmService): assert dd.ports addr = dd.ip if dd.ip else self._inventory_get_addr(dd.hostname) deps.append(dd.name()) - snmp_gateway_urls.append(f"http://{addr}:{dd.ports[0]}/alerts") + + snmp_gateway_urls.append(build_url(scheme='http', host=addr, + port=dd.ports[0], path='/alerts')) context = { 'dashboard_urls': dashboard_urls,