From: John Mulligan Date: Mon, 9 Mar 2026 20:03:28 +0000 (-0400) Subject: mgr/cephadm: use new choose_next_action when so configured X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3a46e9afb2964180a37ffd99f4bea15a651e1290;p=ceph.git mgr/cephadm: use new choose_next_action when so configured Use the newly added choose_next_action when a CephadmService subclasss sets the manages_own_next_action class attribute to true. This allows us to incrementally "opt in" classes to use the choose_next_action method until all classes have been updated to use that instead of code directly in _check_daemons. Signed-off-by: John Mulligan --- diff --git a/src/pybind/mgr/cephadm/serve.py b/src/pybind/mgr/cephadm/serve.py index ee969ab628be..9146a925ff9e 100644 --- a/src/pybind/mgr/cephadm/serve.py +++ b/src/pybind/mgr/cephadm/serve.py @@ -1173,6 +1173,30 @@ class CephadmServe: f'{dd.name()} daemon entrypoint args {dd.extra_entrypoint_args} -> {spec.extra_entrypoint_args}') dd.extra_entrypoint_args = spec.extra_entrypoint_args action = 'redeploy' + elif svc_obj.manages_own_next_action: + # method uses new action enum type + _scheduled_action = utils.Action.create(scheduled_action) + _action = svc_obj.choose_next_action( + _scheduled_action, + dd.daemon_type, + spec, + curr_deps=deps, + last_deps=last_deps, + ) + if _action is not _scheduled_action: + self.log.info( + ( + 'Daemon %s chose new action %s (was %s)' + ' (deps: %r, last_deps: %r)' + ), + dd.name(), + _action, + _scheduled_action, + deps, + last_deps, + ) + # convert back to legacy str type + action = str(_action) elif last_deps != deps: sym_diff = set(deps).symmetric_difference(last_deps) self.log.info(f'Reconfiguring {dd.name()} deps {last_deps} -> {deps} (diff {sym_diff})')