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)
# 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