From: Sage Weil Date: Sun, 8 Mar 2020 17:05:47 +0000 (-0500) Subject: mgr/cephadm: make placement truly optional (default to count=1) X-Git-Tag: v15.1.1~60^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0bb29996ae60af45f3f28e490096352b48ada312;p=ceph-ci.git mgr/cephadm: make placement truly optional (default to count=1) If no placement information is provided at all, assume 1 daemon over any host. This could perhaps be improved with a default placement that varies by daemon type... Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 362dbeb8db1..945f0c3a666 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -2998,7 +2998,6 @@ class HostAssignment(object): logger.debug('All hosts: {}'.format(candidates)) return candidates - count = 0 if self.spec.placement.hosts and \ self.spec.placement.count and \ @@ -3028,9 +3027,11 @@ class HostAssignment(object): else: # this should be a totally empty spec given all of the # alternative paths above. - raise OrchestratorValidationError( - "Cannot place service %s without any placement information" % ( - self.service_name)) + assert self.spec.placement.count is None + assert not self.spec.placement.hosts + assert not self.spec.placement.label + assert not self.spec.placement.all_hosts + count = 1 logger.debug('place %d over all hosts: %s' % (count, hosts)) # we need to select a subset of the candidates