]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm/schedule: match placement ip only combination with port
authorSage Weil <sage@newdream.net>
Thu, 11 Mar 2021 23:40:22 +0000 (18:40 -0500)
committerSage Weil <sage@newdream.net>
Fri, 19 Mar 2021 13:59:46 +0000 (08:59 -0500)
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 <sage@newdream.net>
(cherry picked from commit 5db8ff54864f5cb2d72108d00324e22ea3867ff5)

src/pybind/mgr/cephadm/schedule.py

index 3a4c3cad29528a806851cd3e9bf16129bdceb470..98e3798a02aa8fdba99062b63de02ceacf02241c 100644 (file)
@@ -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