]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: default status for daemons on maintenance hosts to stopped
authorAdam King <adking@redhat.com>
Wed, 14 Apr 2021 20:07:46 +0000 (16:07 -0400)
committerAdam King <adking@redhat.com>
Tue, 20 Apr 2021 18:43:55 +0000 (14:43 -0400)
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>
src/pybind/mgr/cephadm/inventory.py

index 11ed505b334d972cb83cb19d7b68376e50cfc408..c80348cca7799edc70942ea0b9bd183b7079106b 100644 (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