From 0bb29996ae60af45f3f28e490096352b48ada312 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sun, 8 Mar 2020 12:05:47 -0500 Subject: [PATCH] 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 --- src/pybind/mgr/cephadm/module.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 362dbeb8db1f9..945f0c3a6668e 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 -- 2.39.5