mgr/cephadm: default status for daemons on maintenance hosts to stopped

we do not refresh the daemons on maintenance hosts so our info
on them is always outdated. Therefore, the best option is to
assume maintenance mode is working correctly and the daemons
are stopped

Signed-off-by: Adam King <adking@redhat.com>
This commit is contained in:
Adam King 2021-04-14 16:07:46 -04:00
parent 477b705fe7
commit 56641742a7

View File

@ -524,6 +524,11 @@ class HostCache():
if host in self.mgr.offline_hosts:
dd.status = orchestrator.DaemonDescriptionStatus.error
dd.status_desc = 'host is offline'
elif self.mgr.inventory._inventory[host].get("status", "").lower() == "maintenance":
# We do not refresh daemons on hosts in maintenance mode, so stored daemon statuses
# could be wrong. We must assume maintenance is working and daemons are stopped
dd.status = orchestrator.DaemonDescriptionStatus.stopped
dd.status_desc = 'stopped'
dd.events = self.mgr.events.get_for_daemon(dd.name())
return dd