Compare commits

...

No commits in common. 'c9' and 'cs10' have entirely different histories.
c9 ... cs10

24
.gitignore vendored

@ -3,21 +3,19 @@ SOURCES/base64-0.2.0.gem
SOURCES/childprocess-5.0.0.gem
SOURCES/dacite-1.8.1.tar.gz
SOURCES/ethon-0.16.0.gem
SOURCES/ffi-1.16.3.gem
SOURCES/mustermann-3.0.0.gem
SOURCES/nio4r-2.7.3.gem
SOURCES/pcs-0.11.8.tar.gz
SOURCES/pcs-web-ui-0.1.20.tar.gz
SOURCES/pcs-web-ui-node-modules-0.1.20.tar.xz
SOURCES/puma-6.4.2.gem
SOURCES/ffi-1.17.0.gem
SOURCES/mustermann-3.0.3.gem
SOURCES/nio4r-2.7.4.gem
SOURCES/pcs-1353dfbb3af82d77f4de17a3fa4cbde185bb2b2d.tar.gz
SOURCES/pcs-web-ui-34372d1268f065ed186546f55216aaa2d7e76b54.tar.gz
SOURCES/pcs-web-ui-node-modules-0.1.21.tar.xz
SOURCES/puma-6.4.3.gem
SOURCES/pyagentx-0.4.pcs.2.tar.gz
SOURCES/rack-3.0.11.gem
SOURCES/pycurl-7.45.3.tar.gz
SOURCES/rack-3.1.8.gem
SOURCES/rack-protection-4.0.0.gem
SOURCES/rack-session-2.0.0.gem
SOURCES/rack-test-2.1.0.gem
SOURCES/rackup-2.1.0.gem
SOURCES/ruby2_keywords-0.0.5.gem
SOURCES/rackup-2.2.1.gem
SOURCES/sinatra-4.0.0.gem
SOURCES/tilt-2.3.0.gem
SOURCES/tornado-6.4.0.tar.gz
SOURCES/webrick-1.8.1.gem
SOURCES/tilt-2.4.0.gem

@ -3,21 +3,19 @@ ea3a591bdfa93655d8eec9d7bdd7fb87ecb5616a SOURCES/base64-0.2.0.gem
8f910640f84d085707138aa70d6eedb7df10ca73 SOURCES/childprocess-5.0.0.gem
07b26abbf7ff0dcba5c7f9e814ff7eebafefb058 SOURCES/dacite-1.8.1.tar.gz
5b56a68268708c474bef04550639ded3add5e946 SOURCES/ethon-0.16.0.gem
10e4cf0e11ef4581ec4ad5fe2cdf3c78b6077d39 SOURCES/ffi-1.16.3.gem
e892678aaf02ccb27f3a6cd58482cda00aea6ce8 SOURCES/mustermann-3.0.0.gem
632c455f6e27a5f568e9d24761b8a4246cfcc603 SOURCES/nio4r-2.7.3.gem
ee97cec01761e5b727a265eb551d784dfdc6f548 SOURCES/pcs-0.11.8.tar.gz
c75288254b282cb8aed7307fd18dbdd8dda9252d SOURCES/pcs-web-ui-0.1.20.tar.gz
1dbe81ac08cfe60da25cc8650292cdc7c33cdb89 SOURCES/pcs-web-ui-node-modules-0.1.20.tar.xz
623cb3ebec75de449cad3c9f50d5d370edf9e2f9 SOURCES/puma-6.4.2.gem
8edfdd7cc314b5dc84851ea05b6fceedadf386a1 SOURCES/ffi-1.17.0.gem
249a573022dde130372f0ebbeaf2430f36c2b664 SOURCES/mustermann-3.0.3.gem
34b5b1cb50f18d6ec6c5d5cbcb823e7f81f54290 SOURCES/nio4r-2.7.4.gem
09a122796456f783476deb0cf27d3934d7fcf424 SOURCES/pcs-1353dfbb3af82d77f4de17a3fa4cbde185bb2b2d.tar.gz
e6f16c816ed78545b64f4072d8156e98c41c9d9c SOURCES/pcs-web-ui-34372d1268f065ed186546f55216aaa2d7e76b54.tar.gz
73838169577c2ec6c1dae9bf6b0c371cc7c12020 SOURCES/pcs-web-ui-node-modules-0.1.21.tar.xz
f72357acbdcfd68b4b41a999ed47926c0e54ea5e SOURCES/puma-6.4.3.gem
3176b2f2b332c2b6bf79fe882e83feecf3d3f011 SOURCES/pyagentx-0.4.pcs.2.tar.gz
a156440aaee17f60b83f2f681ec60fce2329a480 SOURCES/rack-3.0.11.gem
d36e54b3d6d36460dae0c7a2b9971d72d16d8225 SOURCES/pycurl-7.45.3.tar.gz
a7f73594003243ebf00f8cb2716665a054b378b4 SOURCES/rack-3.1.8.gem
f91158b296882aa5b3798ff6c24f01cdf233ef48 SOURCES/rack-protection-4.0.0.gem
9e7935696af0b64cc5f5ce2dfeabdb7e0d3a84f0 SOURCES/rack-session-2.0.0.gem
ae09ea83748b55875edc3708fffba90db180cb8e SOURCES/rack-test-2.1.0.gem
657a2dc63695e1bf9eb5feae4d9d65a7c6b900ad SOURCES/rackup-2.1.0.gem
d017b9e4d1978e0b3ccc3e2a31493809e4693cd3 SOURCES/ruby2_keywords-0.0.5.gem
efa414fe946ccc1f70e64337d206e98807baa717 SOURCES/rackup-2.2.1.gem
28c671c6d061475ed2bfd3e6a4a17970a0a12d8a SOURCES/sinatra-4.0.0.gem
4a38a9a55887b2882182a2c5771e592efe514e5e SOURCES/tilt-2.3.0.gem
ee95560139af1bb8d0d49d4acf0518deb04877d2 SOURCES/tornado-6.4.0.tar.gz
0696afa9cc0b56f541aacb7483aecdb385a5bd37 SOURCES/webrick-1.8.1.gem
ad6225a8c3b4b66f88ae878d76ef6dec1d0c2f9e SOURCES/tilt-2.4.0.gem

@ -1,144 +0,0 @@
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,7 +1,7 @@
From 071b189a3a72610361f8d31d2ebbb0b9083c872f Mon Sep 17 00:00:00 2001
From: Ivan Devat <idevat@redhat.com>
Date: Tue, 20 Nov 2018 15:03:56 +0100
Subject: [PATCH] do not support cluster setup with udp(u) transport in RHEL9
From 7bfa2ad4f4f5f59fd501b0cec23cdc489f90a09e Mon Sep 17 00:00:00 2001
From: Michal Pospisil <mpospisi@redhat.com>
Date: Thu, 23 May 2024 17:22:12 +0200
Subject: [PATCH] do not support cluster setup with udp(u) transport in RHEL10
---
pcs/pcs.8.in | 2 ++
@ -9,30 +9,30 @@ Subject: [PATCH] do not support cluster setup with udp(u) transport in RHEL9
2 files changed, 3 insertions(+)
diff --git a/pcs/pcs.8.in b/pcs/pcs.8.in
index 63c40b78..f69a75b8 100644
index 0bc1a4e5..4dea3582 100644
--- a/pcs/pcs.8.in
+++ b/pcs/pcs.8.in
@@ -479,6 +479,8 @@ By default, encryption is enabled with cipher=aes256 and hash=sha256. To disable
Transports udp and udpu:
.br
+WARNING: These transports are not supported in RHEL 9.
+WARNING: These transports are not supported in RHEL 10.
+.br
These transports are limited to one address per node. They do not support traffic encryption nor compression.
.br
Transport options are: ip_version, netmtu
diff --git a/pcs/usage.py b/pcs/usage.py
index a4af30d4..7c7fc7ea 100644
index 26204c59..31eba549 100644
--- a/pcs/usage.py
+++ b/pcs/usage.py
@@ -1490,6 +1490,7 @@ Commands:
@@ -1496,6 +1496,7 @@ Commands:
hash=sha256. To disable encryption, set cipher=none and hash=none.
Transports udp and udpu:
+ WARNING: These transports are not supported in RHEL 9.
+ WARNING: These transports are not supported in RHEL 10.
These transports are limited to one address per node. They do not
support traffic encryption nor compression.
Transport options are:
--
2.45.2
2.45.1

@ -0,0 +1,146 @@
From 6e7fa90fc265063b65e3192ed513d0a52b000a2c Mon Sep 17 00:00:00 2001
From: Ivan Devat <idevat@redhat.com>
Date: Tue, 5 Nov 2024 16:35:02 +0100
Subject: [PATCH] show info page instead of webui
---
pcs/Makefile.am | 1 +
pcs/daemon/app/webui_info_handler.py | 31 ++++++++++++++++++++++++++++
pcs/daemon/run.py | 4 +++-
pcs_test/smoke.sh.in | 4 ++--
pcsd/public/ui_instructions.html | 26 ++++++++---------------
5 files changed, 46 insertions(+), 20 deletions(-)
create mode 100644 pcs/daemon/app/webui_info_handler.py
diff --git a/pcs/Makefile.am b/pcs/Makefile.am
index 28244dd7..4d4401fa 100644
--- a/pcs/Makefile.am
+++ b/pcs/Makefile.am
@@ -206,6 +206,7 @@ EXTRA_DIST = \
daemon/app/webui/core.py \
daemon/app/webui/session.py \
daemon/app/webui/sinatra_ui.py \
+ daemon/app/webui_info_handler.py \
daemon/async_tasks/__init__.py \
daemon/async_tasks/scheduler.py \
daemon/async_tasks/task.py \
diff --git a/pcs/daemon/app/webui_info_handler.py b/pcs/daemon/app/webui_info_handler.py
new file mode 100644
index 00000000..3ab8275b
--- /dev/null
+++ b/pcs/daemon/app/webui_info_handler.py
@@ -0,0 +1,31 @@
+from pcs.daemon.app.common import (
+ BaseHandler,
+ RoutesType,
+)
+
+
+class _WebuiInfoHandler(BaseHandler):
+ __path = None
+
+ def initialize(self, path):
+ self.__path = path
+
+ def get(self):
+ self.set_status(404)
+ self.render(self.__path)
+
+
+def get_routes(path: str) -> RoutesType:
+ return [
+ # The following two rules can be compressed into one: r"/(ui/?)?".
+ # However, the content of the parentheses used here should be captured
+ # and passed in to the handlers get method as an argument.
+ # Unfortunately, it seems that tornado version 6.4.1 don't pass this
+ # argument (unlike version 6.3.3). Maybe it's a bug (it needs further
+ # inspection). These rules are a safe way to avoid surprises.
+ # Moreover, the captured parameter is irrelevant to the functionality
+ # of the handler.
+ (r"/", _WebuiInfoHandler, dict(path=path)),
+ (r"/ui/?", _WebuiInfoHandler, dict(path=path)),
+ (r"/ui/.*", _WebuiInfoHandler, dict(path=path)),
+ ]
diff --git a/pcs/daemon/run.py b/pcs/daemon/run.py
index b555bc18..10e394eb 100644
--- a/pcs/daemon/run.py
+++ b/pcs/daemon/run.py
@@ -35,6 +35,7 @@ from pcs.daemon.app import capabilities as capabilities_app
from pcs.daemon.app import (
sinatra_remote,
sinatra_ui,
+ webui_info_handler,
)
try:
@@ -141,7 +142,8 @@ def configure_app(
# Even with disabled (standalone) webui the following routes must be
# provided because they can be used via unix socket from cockpit.
routes.extend(
- sinatra_ui.get_routes(auth_provider, ruby_pcsd_wrapper)
+ webui_info_handler.get_routes(webui_fallback)
+ + sinatra_ui.get_routes(auth_provider, ruby_pcsd_wrapper)
)
return Application(
diff --git a/pcs_test/smoke.sh.in b/pcs_test/smoke.sh.in
index fdfe8be2..a9bb8344 100755
--- a/pcs_test/smoke.sh.in
+++ b/pcs_test/smoke.sh.in
@@ -71,10 +71,10 @@ if [ "$webui_http_code_response" = "200" ]; then
curl --insecure --cookie ${cookie_file} --header "X-Requested-With: XMLHttpRequest" --data "hidden[hidden_input]=&config[stonith-enabled]=false" https://localhost:2224/managec/${cluster_name}/update_cluster_settings > "${output_file}"
cat "${output_file}"; echo ""
[ "$(cat ${output_file})" = "Update Successful" ]
-elif [ "$webui_http_code_response" = "401" ]; then
+elif [ "$webui_http_code_response" = "404" ]; then
curl --insecure https://localhost:2224/ui/ > "${output_file}"
cat "${output_file}"; echo ""
- [ "$(cat "${output_file}")" = '{"notauthorized":"true"}' ]
+ grep "HA cluster management has been moved" "${output_file}"
else
echo "Unexpected response from https://localhost:2224/ui/ - http code: '${webui_http_code_response}'"
exit 1
diff --git a/pcsd/public/ui_instructions.html b/pcsd/public/ui_instructions.html
index a120ed3d..5f9214d0 100644
--- a/pcsd/public/ui_instructions.html
+++ b/pcsd/public/ui_instructions.html
@@ -1,27 +1,19 @@
<!DOCTYPE html>
<html>
<head>
- <title>Pcs WebUI instructions</title>
+ <title>HA cluster management has been moved</title>
<meta charset="utf-8" />
</head>
<body>
- <h1>Pcs WebUI instructions</h1>
+ <h1>HA cluster management has been moved</h1>
<p>
- WebUI is not a part of pcs repository but it has its own
- <a href="https://github.com/ClusterLabs/pcs-web-ui">repository</a>.
- </p>
- <p>
- You can clone <a href="https://github.com/ClusterLabs/pcs-web-ui">WebUI repository</a>
- and build the web application into pcs by:
- </p>
- <pre><code>
- $ npm install
- $ npm run build
- $ mv ./build [/path/to/]pcs/pcsd/public/ui
- </code></pre>
- <p>
- For more details, see instructions in
- <a href="https://github.com/ClusterLabs/pcs-web-ui/blob/main/README.md">README.md</a>.
+ Since RHEL 10.0, pcsd web UI is no longer available. Management of high
+ availability clusters has been moved to an add-on for the RHEL web console.
+ The HA Cluster Management add-on can be installed from the cockpit-ha-cluster
+ RPM package or from the RHEL web console. To learn more, please visit:
+ <a href="https://access.redhat.com/solutions/7099451">
+ https://access.redhat.com/solutions/7099451
+ </a>
</p>
</body>
</html>
--
2.47.0

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save