From 3e35324dd70771d7f52d5e055d778069897f6b58 Mon Sep 17 00:00:00 2001 From: Adam King Date: Fri, 21 Oct 2022 11:57:53 -0400 Subject: 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 --- src/pybind/mgr/cephadm/module.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index a226e808502..1a523ed9f98 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -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: -- cgit v1.2.3