import pcs-0.11.8-1.el9_5.1

c9 imports/c9/pcs-0.11.8-1.el9_5.1
MSVSphere Packaging Team 2 months ago
parent 6221de44ac
commit 3e406f28a2
Signed by: sys_gitsync
GPG Key ID: B2B0B9F29E528FE8

@ -0,0 +1,144 @@
From 7a2ea3c95c99b0f3eacc99816c9aa6febfad6c5e Mon Sep 17 00:00:00 2001
From: Miroslav Lisik <mlisik@redhat.com>
Date: Thu, 17 Oct 2024 17:04:37 +0200
Subject: [PATCH] fix `pcs dr status`
* add command status.full_cluster_status_plaintext to the API_V1_MAP
* fix ClusterStatusLegacyHandler
* fix `pcs cluster node add-outside`
* fix ClusterAddNodesLegacyHandler
---
pcs/common/reports/messages.py | 17 +++++++----------
pcs/daemon/app/api_v1.py | 5 +++--
pcs_test/smoke.sh.in | 14 +++++++-------
pcsd/capabilities.xml.in | 7 +++++++
4 files changed, 24 insertions(+), 19 deletions(-)
diff --git a/pcs/common/reports/messages.py b/pcs/common/reports/messages.py
index ccf32a03..9a1543e1 100644
--- a/pcs/common/reports/messages.py
+++ b/pcs/common/reports/messages.py
@@ -260,7 +260,7 @@ def _stonith_watchdog_timeout_reason_to_str(
}.get(reason, reason)
-@dataclass(frozen=True, init=False)
+@dataclass(frozen=True)
class LegacyCommonMessage(ReportItemMessage):
"""
This class is used for legacy report transport protocol from
@@ -268,22 +268,19 @@ class LegacyCommonMessage(ReportItemMessage):
should be replaced with transporting DTOs of reports in the future.
"""
- def __init__(
- self, code: types.MessageCode, info: Mapping[str, Any], message: str
- ) -> None:
- self.__code = code
- self.info = info
- self._message = message
+ legacy_code: types.MessageCode
+ legacy_info: Mapping[str, Any]
+ legacy_message: str
@property
def message(self) -> str:
- return self._message
+ return self.legacy_message
def to_dto(self) -> ReportItemMessageDto:
return ReportItemMessageDto(
- code=self.__code,
+ code=self.legacy_code,
message=self.message,
- payload=dict(self.info),
+ payload=dict(self.legacy_info),
)
diff --git a/pcs/daemon/app/api_v1.py b/pcs/daemon/app/api_v1.py
index 8e8b8804..5babad1d 100644
--- a/pcs/daemon/app/api_v1.py
+++ b/pcs/daemon/app/api_v1.py
@@ -101,6 +101,7 @@ API_V1_MAP: Mapping[str, str] = {
"sbd-enable-sbd/v1": "sbd.enable_sbd",
"scsi-unfence-node/v2": "scsi.unfence_node",
"scsi-unfence-node-mpath/v1": "scsi.unfence_node_mpath",
+ "status-full-cluster-status-plaintext/v1": "status.full_cluster_status_plaintext",
# deprecated, use resource-agent-get-agent-metadata/v1 instead
"stonith-agent-describe-agent/v1": "stonith_agent.describe_agent",
# deprecated, use resource-agent-get-agents-list/v1 instead
@@ -301,13 +302,13 @@ class LegacyApiV1Handler(_BaseApiV1Handler):
class ClusterStatusLegacyHandler(LegacyApiV1Handler):
@staticmethod
def _get_cmd() -> str:
- return "status.full_cluster_status_plaintext"
+ return "status-full-cluster-status-plaintext/v1"
class ClusterAddNodesLegacyHandler(LegacyApiV1Handler):
@staticmethod
def _get_cmd() -> str:
- return "cluster.add_nodes"
+ return "cluster-add-nodes/v1"
def get_routes(scheduler: Scheduler, auth_provider: AuthProvider) -> RoutesType:
diff --git a/pcs_test/smoke.sh.in b/pcs_test/smoke.sh.in
index a4b3ac71..bfbb427e 100755
--- a/pcs_test/smoke.sh.in
+++ b/pcs_test/smoke.sh.in
@@ -23,12 +23,6 @@ output_file=$(mktemp)
token_file=$(mktemp)
cookie_file=$(mktemp)
-# Sanity check of API V0
-token=$(python3 -c "import json; print(json.load(open('@LOCALSTATEDIR@/lib/pcsd/known-hosts'))['known_hosts']['localhost']['token']);")
-curl -kb "token=${token}" https://localhost:2224/remote/cluster_status_plaintext -d 'data_json={}' > "${output_file}"
-cat "${output_file}"; echo ""
-python3 -c "import json; import sys; json.load(open('${output_file}'))['status'] == 'exception' and (sys.exit(1))";
-
dd if=/dev/urandom bs=32 count=1 status=none | base64 > "${token_file}"
custom_localhost_node_name="custom-node-name"
@@ -71,6 +65,12 @@ curl --insecure --cookie ${cookie_file} --header "X-Requested-With: XMLHttpReque
cat "${output_file}"; echo ""
[ "$(cat ${output_file})" = "Update Successful" ]
+# Sanity check of API V0
+token=$(python3 -c "import json; print(json.load(open('@LOCALSTATEDIR@/lib/pcsd/known-hosts'))['known_hosts']['localhost']['token']);")
+curl -kb "token=${token}" https://localhost:2224/remote/cluster_status_plaintext -d 'data_json={}' > "${output_file}"
+cat "${output_file}"; echo ""
+python3 -c "import json; import sys; json.load(open('${output_file}'))['status'] != 'success' and (sys.exit(1))";
+
# Sanity check of API V1
curl -kb "token=${token}" https://localhost:2224/api/v1/resource-agent-get-agents-list/v1 --data '{}' > "${output_file}"
cat "${output_file}"; echo ""
@@ -98,5 +98,5 @@ rm "${output_file}"
rm "${cookie_file}"
rm "${pcsd_settings_conf_path}"
pcs cluster destroy --force
-userdel -r testuser
+userdel -rf testuser
exit 0
diff --git a/pcsd/capabilities.xml.in b/pcsd/capabilities.xml.in
index 99d5af3f..b9c28560 100644
--- a/pcsd/capabilities.xml.in
+++ b/pcsd/capabilities.xml.in
@@ -2661,6 +2661,13 @@
daemon urls: pacemaker_node_status
</description>
</capability>
+ <capability id="status.pcmk.full-cluster-status-plaintext" in-pcs="0" in-pcsd="1">
+ <description>
+ Display status of the remote site cluster.
+
+ daemon urls: /api/v1/status-full-cluster-status-plaintext/v1
+ </description>
+ </capability>
<capability id="status.pcmk.query.resource" in-pcs="1" in-pcsd="0">
<description>
Query status of resources.
--
2.47.0

@ -1,6 +1,6 @@
Name: pcs
Version: 0.11.8
Release: 1%{?dist}
Release: 1%{?dist}.1
# https://docs.fedoraproject.org/en-US/packaging-guidelines/LicensingGuidelines/
# https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses
# GPL-2.0-only: pcs
@ -109,6 +109,7 @@ Source101: https://github.com/ClusterLabs/pcs-web-ui/releases/download/%{ui_comm
# pcs patches: <= 200
# Patch0: bzNUMBER-01-name.patch
Patch0: do-not-support-cluster-setup-with-udp-u-transport.patch
Patch1: RHEL-64934-01-fix-pcs-dr-status.patch
# ui patches: >200
# Patch201: bzNUMBER-01-name.patch
@ -305,6 +306,7 @@ update_times_patch(){
%autopatch -p1 -M 200
# update_times_patch %%{PATCH0}
update_times_patch %{PATCH0}
update_times_patch %{PATCH1}
# generate .tarball-version if building from an untagged commit, not a released version
# autogen uses git-version-gen which uses .tarball-version for generating version number
@ -559,6 +561,10 @@ run_all_tests
%license pyagentx_LICENSE.txt
%changelog
* Thu Nov 14 2024 Miroslav Lisik <mlisik@redhat.com> - 0.11.8-1.el9_5.1
- Fixed command `pcs dr status`
Resolves: RHEL-64934
* Tue Jul 9 2024 Michal Pospisil <mpospisi@redhat.com> - 0.11.8-1
- Updated pcs-web-ui to 0.1.20
- Rebased to the latest sources (see CHANGELOG.md)

Loading…
Cancel
Save