From: Sage Weil Date: Thu, 11 Mar 2021 23:40:22 +0000 (-0500) Subject: mgr/cephadm/schedule: match placement ip only combination with port X-Git-Tag: v16.2.0~73^2~24 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=94220b8860f0fccfe0480e6aca6a40b1784540ad;p=ceph.git mgr/cephadm/schedule: match placement ip only combination with port 1- We only have an IP to bind to if we also have a port, and 2- If we do, we want an exact match: if the DaemonPlacement has ip of None, then the DaemonDescription should have None too. Signed-off-by: Sage Weil (cherry picked from commit 5db8ff54864f5cb2d72108d00324e22ea3867ff5) --- diff --git a/src/pybind/mgr/cephadm/schedule.py b/src/pybind/mgr/cephadm/schedule.py index 3a4c3cad295..98e3798a02a 100644 --- a/src/pybind/mgr/cephadm/schedule.py +++ b/src/pybind/mgr/cephadm/schedule.py @@ -48,10 +48,11 @@ class DaemonPlacement(NamedTuple): # fixme: how to match against network? if self.name and self.name != dd.daemon_id: return False - if self.ip and self.ip != dd.ip: - return False - if self.port and [self.port] != dd.ports: - return False + if self.port: + if [self.port] != dd.ports: + return False + if self.ip != dd.ip: + return False return True