From: Sebastian Wagner Date: Tue, 9 Jun 2020 12:57:48 +0000 (+0200) Subject: mgr/cephadm: scheduler: make use of ok-to-stop X-Git-Tag: v15.2.5~147^2~22 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=40409e310cea627fdc7490c3f0df14c648a5b8a0;p=ceph.git mgr/cephadm: scheduler: make use of ok-to-stop Signed-off-by: Sebastian Wagner (cherry picked from commit f42182587057e8e18661f0b7570c7af1617e3506) --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 1963a69b606a..9160a2cde040 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -1839,6 +1839,10 @@ you may want to run: r = True # remove any? + while remove_daemon_hosts and not self.cephadm_services[daemon_type].ok_to_stop( + [d.daemon_id for d in remove_daemon_hosts]): + # let's find a subset that is ok-to-stop + remove_daemon_hosts.pop() for d in remove_daemon_hosts: # NOTE: we are passing the 'force' flag here, which means # we can delete a mon instances data. diff --git a/src/pybind/mgr/orchestrator/_interface.py b/src/pybind/mgr/orchestrator/_interface.py index 9eac046a07db..7de5c00d6caa 100644 --- a/src/pybind/mgr/orchestrator/_interface.py +++ b/src/pybind/mgr/orchestrator/_interface.py @@ -1238,7 +1238,7 @@ class DaemonDescription(object): # typically either based on hostnames or on pod names. # This is the in mds., the ID that will appear # in the FSMap/ServiceMap. - self.daemon_id = daemon_id + self.daemon_id: str = daemon_id # Service version that was deployed self.version = version