From 5db8ff54864f5cb2d72108d00324e22ea3867ff5 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 11 Mar 2021 18:40:22 -0500 Subject: [PATCH] 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 --- src/pybind/mgr/cephadm/schedule.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pybind/mgr/cephadm/schedule.py b/src/pybind/mgr/cephadm/schedule.py index 3a4c3cad29528..98e3798a02aa8 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 -- 2.39.5