From 4e20140ecf673f95e9424ab1c938398fa9ea68bc Mon Sep 17 00:00:00 2001 From: Shweta Bhosale Date: Thu, 27 Nov 2025 22:08:42 +0530 Subject: [PATCH] mgr/cephadm: Fixed cache update for updating daemon user_stopped status Fixes: https://tracker.ceph.com/issues/73442 Signed-off-by: Shweta Bhosale --- src/pybind/mgr/cephadm/module.py | 8 ++++---- src/pybind/mgr/orchestrator/_interface.py | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 91dff724ad62..2072a8bf5b49 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -3147,11 +3147,11 @@ Then run the following: # Track user-initiated stop/start actions if action == 'stop': - d.user_stopped = True - self.cache.update_host_daemons(d.hostname, {d.name(): d}) + d.update_user_stopped_status(True) + self.cache.save_host(d.hostname) elif action in ['start', 'restart']: - d.user_stopped = False - self.cache.update_host_daemons(d.hostname, {d.name(): d}) + d.update_user_stopped_status(False) + self.cache.save_host(d.hostname) self._daemon_action_set_image(action, image, d.daemon_type, d.daemon_id) diff --git a/src/pybind/mgr/orchestrator/_interface.py b/src/pybind/mgr/orchestrator/_interface.py index 816c4c43be97..384e743a8c05 100644 --- a/src/pybind/mgr/orchestrator/_interface.py +++ b/src/pybind/mgr/orchestrator/_interface.py @@ -1428,6 +1428,9 @@ class DaemonDescription(object): def update_pending_daemon_config(self, value: bool) -> None: self.pending_daemon_config = value + def update_user_stopped_status(self, value: bool) -> None: + self.user_stopped = value + def __repr__(self) -> str: return "({type}.{id})".format(type=self.daemon_type, id=self.daemon_id) -- 2.47.3