]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: abort upgrade if there are offline hosts.
authorAdam King <adking@redhat.com>
Fri, 21 Oct 2022 15:57:53 +0000 (11:57 -0400)
committerAdam King <adking@redhat.com>
Fri, 21 Oct 2022 17:13:46 +0000 (13:13 -0400)
We won't be able to complete the upgrade if there are offline
hosts anyway so we might as well abort immediately.

Signed-off-by: Adam King <adking@redhat.com>
src/pybind/mgr/cephadm/module.py

index a226e808502cde4c5b913dc3bec8d492463cd432..1a523ed9f981d877edde417c49b367fc6957aa68 100644 (file)
@@ -2989,7 +2989,9 @@ Then run the following:
     def upgrade_start(self, image: str, version: str, daemon_types: Optional[List[str]] = None, host_placement: Optional[str] = None,
                       services: Optional[List[str]] = None, limit: Optional[int] = None) -> str:
         if self.inventory.get_host_with_state("maintenance"):
-            raise OrchestratorError("upgrade aborted - you have host(s) in maintenance state")
+            raise OrchestratorError("Upgrade aborted - you have host(s) in maintenance state")
+        if self.offline_hosts:
+            raise OrchestratorError(f"Upgrade aborted - Some host(s) are currently offline: {self.offline_hosts}")
         if daemon_types is not None and services is not None:
             raise OrchestratorError('--daemon-types and --services are mutually exclusive')
         if daemon_types is not None: