From 942e6b3c23ce1d9c317cd24dcbf48710b7ea4544 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Fri, 3 Jun 2022 17:16:54 +0200 Subject: [PATCH] cephadm: add 'is_paused' field in orch status output it can be convenient for automation tool if `orch status` output reports whether the upgrade is currently paused. Fixes: https://tracker.ceph.com/issues/55843 Signed-off-by: Guillaume Abrioux (cherry picked from commit de1c428dfe9744b0585a42f1862b4f9ee46c22b2) --- src/pybind/mgr/cephadm/upgrade.py | 1 + src/pybind/mgr/orchestrator/_interface.py | 1 + src/pybind/mgr/orchestrator/module.py | 1 + 3 files changed, 3 insertions(+) diff --git a/src/pybind/mgr/cephadm/upgrade.py b/src/pybind/mgr/cephadm/upgrade.py index d41b9286ec223..d0a5fd4af4424 100644 --- a/src/pybind/mgr/cephadm/upgrade.py +++ b/src/pybind/mgr/cephadm/upgrade.py @@ -147,6 +147,7 @@ class CephadmUpgrade: r.target_image = self.target_image r.in_progress = True r.progress, r.services_complete = self._get_upgrade_info() + r.is_paused = self.upgrade_state.paused if self.upgrade_state.daemon_types is not None: which_str = f'Upgrading daemons of type(s) {",".join(self.upgrade_state.daemon_types)}' diff --git a/src/pybind/mgr/orchestrator/_interface.py b/src/pybind/mgr/orchestrator/_interface.py index b0ccf73570b77..c9414d797bb25 100644 --- a/src/pybind/mgr/orchestrator/_interface.py +++ b/src/pybind/mgr/orchestrator/_interface.py @@ -783,6 +783,7 @@ class UpgradeStatusSpec(object): self.which: str = '' # for if user specified daemon types, services or hosts self.progress: Optional[str] = None # How many of the daemons have we upgraded self.message = "" # Freeform description + self.is_paused: bool = False # Is the upgrade paused? def handle_type_error(method: FuncT) -> FuncT: diff --git a/src/pybind/mgr/orchestrator/module.py b/src/pybind/mgr/orchestrator/module.py index a18d1ca4f3799..0dd5c23f71248 100644 --- a/src/pybind/mgr/orchestrator/module.py +++ b/src/pybind/mgr/orchestrator/module.py @@ -1421,6 +1421,7 @@ Usage: 'services_complete': status.services_complete, 'progress': status.progress, 'message': status.message, + 'is_paused': status.is_paused, } out = json.dumps(r, indent=4) return HandleCommandResult(stdout=out) -- 2.39.5