From 1e121406c77db72ecad7a1093e6bbacb65cbb7b3 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 29 Jun 2021 18:47:13 -0400 Subject: [PATCH] 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) --- src/pybind/mgr/mgr_module.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/mgr_module.py b/src/pybind/mgr/mgr_module.py index dd558ec61eecf..f44a776e18696 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()) -- 2.39.5