From: Guillaume Abrioux Date: Fri, 3 Jun 2022 15:16:54 +0000 (+0200) Subject: cephadm: add 'is_paused' field in orch status output X-Git-Tag: v18.0.0~744^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=de1c428dfe9744b0585a42f1862b4f9ee46c22b2;p=ceph-ci.git 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 --- diff --git a/src/pybind/mgr/cephadm/upgrade.py b/src/pybind/mgr/cephadm/upgrade.py index d1b3c098ff7..baa3cce161c 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 b0ccf73570b..c9414d797bb 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 a18d1ca4f37..0dd5c23f712 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)