Eevery call of find_ip_on_host() actually duplicates the list of public ip
addresses in self.networks, while it should NOT change it. As the result
value of key mgr/cephadm/host.<hostname> in kv store becomes very large
and may cause crash of ceph mgr.
Signed-off-by: Andrew Sharapov <andrewshar@gmail.com>
(cherry picked from commit
b605b786a2ec95606a2c2791cc643dda3fbe24cc)
def find_ip_on_host(self, hostname: str, subnets: List[str]) -> Optional[str]:
for subnet in subnets:
ips: List[str] = []
- for iface, ips in self.networks.get(hostname, {}).get(subnet, {}).items():
- ips.extend(ips)
+ for iface, iface_ips in self.networks.get(hostname, {}).get(subnet, {}).items():
+ ips.extend(iface_ips)
if ips:
return sorted(ips)[0]
return None