From: Sage Weil Date: Tue, 29 Jun 2021 22:47:13 +0000 (-0400) Subject: pybind/mgr/mgr_module: use get("mgr_ips") for standby get_mgr_ip() X-Git-Tag: v16.2.5~10^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1e121406c77db72ecad7a1093e6bbacb65cbb7b3;p=ceph.git pybind/mgr/mgr_module: use get("mgr_ips") for standby get_mgr_ip() This is necessary to allow the standby mgr to bind to the right IP. Signed-off-by: Sage Weil (cherry picked from commit d159adc20e005dc7f7a7cea06c2ee7aa6f06d559) --- diff --git a/src/pybind/mgr/mgr_module.py b/src/pybind/mgr/mgr_module.py index dd558ec61eec..f44a776e1869 100644 --- a/src/pybind/mgr/mgr_module.py +++ b/src/pybind/mgr/mgr_module.py @@ -799,8 +799,10 @@ class MgrStandbyModule(ceph_module.BaseMgrStandbyModule, MgrModuleLoggingMixin): return self._ceph_get(data_name) def get_mgr_ip(self) -> str: - # we don't have get() for standby modules; make do with the hostname - return socket.gethostname() + ips = self.get("mgr_ips").get('ips', []) + if not ips: + return socket.gethostname() + return ips[0] def get_localized_module_option(self, key: str, default: OptionValue = None) -> OptionValue: r = self._ceph_get_module_option(key, self.get_mgr_id())