]> 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>
Tue, 16 Mar 2021 17:07:01 +0000 (13:07 -0400)
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>
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