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