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: v16.2.11~490^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cee84195e5b71d0413521023a0ec2cd23b3ea5f0;p=ceph.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 (cherry picked from commit de1c428dfe9744b0585a42f1862b4f9ee46c22b2) --- diff --git a/src/pybind/mgr/cephadm/upgrade.py b/src/pybind/mgr/cephadm/upgrade.py index 3cedae582442..764992716b3b 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 61ef4f5da808..83dbccf5df22 100644 --- a/src/pybind/mgr/orchestrator/_interface.py +++ b/src/pybind/mgr/orchestrator/_interface.py @@ -773,6 +773,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 c9de02f0c80e..a113b0989293 100644 --- a/src/pybind/mgr/orchestrator/module.py +++ b/src/pybind/mgr/orchestrator/module.py @@ -1418,6 +1418,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)