From d54fc29ec8c3a373b25d8bea4906d0aebae1e092 Mon Sep 17 00:00:00 2001 From: Adam King Date: Fri, 21 Oct 2022 11:57:53 -0400 Subject: [PATCH] mgr/cephadm: abort upgrade if there are offline hosts. 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 (cherry picked from commit 3e35324dd70771d7f52d5e055d778069897f6b58) --- src/pybind/mgr/cephadm/module.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index ec6f50c9f2c..0d5e6edc91a 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -2930,7 +2930,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: -- 2.47.3