Merge pull request #43737 from AndrewSharapov/master

mgr/cephadm: Fixed spawning ip addresses list for public network interface

Reviewed-by: Sebastian Wagner <sewagner@redhat.com>
This commit is contained in:
Sebastian Wagner 2021-11-04 10:45:56 +01:00 committed by GitHub
commit 884f89ea6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -361,8 +361,8 @@ class HostAssignment(object):
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