mgr/cephadm: Fixed cache update for updating daemon user_stopped status

Fixes: https://tracker.ceph.com/issues/73442

Signed-off-by: Shweta Bhosale <Shweta.Bhosale1@ibm.com>
This commit is contained in:
Shweta Bhosale 2025-11-27 22:08:42 +05:30
parent 51504dbf2a
commit 4e20140ecf
2 changed files with 7 additions and 4 deletions

View File

@ -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)

View File

@ -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 "<DaemonDescription>({type}.{id})".format(type=self.daemon_type,
id=self.daemon_id)