]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm/schedule: only 1 port in DaemonPlacement
authorSage Weil <sage@newdream.net>
Wed, 10 Mar 2021 18:59:18 +0000 (13:59 -0500)
committerSage Weil <sage@newdream.net>
Mon, 15 Mar 2021 22:55:16 +0000 (18:55 -0400)
It would be weird to dynamically number multiple ports (although doable).
But until we have plans to support something like that, no need to handle
it here.

Signed-off-by: Sage Weil <sage@newdream.net>
src/pybind/mgr/cephadm/schedule.py
src/pybind/mgr/cephadm/serve.py

index 905561585d2bbc165b0143232484b8e9da316d36..b2dad5b0e7cee967fb09a8b0c828d61d92b439da 100644 (file)
@@ -16,7 +16,7 @@ class DaemonPlacement(NamedTuple):
     network: str = ''   # for mons only
     name: str = ''
     ip: Optional[str] = None
-    ports: Optional[List[int]] = None
+    port: Optional[int] = None
 
     def __str__(self) -> str:
         res = self.hostname
@@ -27,8 +27,8 @@ class DaemonPlacement(NamedTuple):
             other.append(f'name={self.name}')
         if self.ip:
             other.append(f'ip={self.ip}')
-        if self.ports:
-            other.append(f'ports={",".join(map(str, self.ports))}')
+        if self.port:
+            other.append(f'port={self.port}')
         if other:
             res += '(' + ' '.join(other) + ')'
         return res
@@ -41,7 +41,7 @@ class DaemonPlacement(NamedTuple):
             return False
         if self.ip and self.ip != dd.ip:
             return False
-        if self.ports and self.ports != dd.ports:
+        if self.port and [self.port] != dd.ports:
             return False
         return True
 
index 5e401981924289fe045beecb76b2d4ae87f6033e..05761118f25f3cb9680bb4d30dc0157dddde9bab 100644 (file)
@@ -600,7 +600,7 @@ class CephadmServe:
 
                 daemon_spec = svc.make_daemon_spec(
                     slot.hostname, daemon_id, slot.network, spec, daemon_type=daemon_type,
-                    ports=slot.ports
+                    ports=[slot.port] if slot.port else None
                 )
                 self.log.debug('Placing %s.%s on host %s' % (
                     daemon_type, daemon_id, slot.hostname))