diff options
author | Adam King <adking@redhat.com> | 2022-10-21 17:57:53 +0200 |
---|---|---|
committer | Adam King <adking@redhat.com> | 2022-10-21 19:13:46 +0200 |
commit | 3e35324dd70771d7f52d5e055d778069897f6b58 (patch) | |
tree | 8b76a3f985646ad5d383b2a3e329bfb752df7bcd /src | |
parent | Merge pull request #48555 from phlogistonjohn/jjm-unify-test-alertmanager-config (diff) | |
download | ceph-3e35324dd70771d7f52d5e055d778069897f6b58.tar.xz ceph-3e35324dd70771d7f52d5e055d778069897f6b58.zip |
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 <adking@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/pybind/mgr/cephadm/module.py | 4 |
1 files changed, 3 insertions, 1 deletions
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: |