import pcs-0.10.15-3.el8
This commit is contained in:
parent
ee54cc0896
commit
2a5856847e
6
.gitignore
vendored
6
.gitignore
vendored
@ -14,12 +14,12 @@ SOURCES/pcs-web-ui-0.1.13.tar.gz
|
||||
SOURCES/pcs-web-ui-node-modules-0.1.13.tar.xz
|
||||
SOURCES/pyagentx-0.4.pcs.2.tar.gz
|
||||
SOURCES/python-dateutil-2.8.2.tar.gz
|
||||
SOURCES/rack-2.2.4.gem
|
||||
SOURCES/rack-protection-2.2.3.gem
|
||||
SOURCES/rack-2.2.5.gem
|
||||
SOURCES/rack-protection-2.2.4.gem
|
||||
SOURCES/rack-test-2.0.2.gem
|
||||
SOURCES/rexml-3.2.5.gem
|
||||
SOURCES/ruby2_keywords-0.0.5.gem
|
||||
SOURCES/sinatra-2.2.3.gem
|
||||
SOURCES/sinatra-2.2.4.gem
|
||||
SOURCES/thin-1.8.1.gem
|
||||
SOURCES/tilt-2.0.11.gem
|
||||
SOURCES/tornado-6.1.0.tar.gz
|
||||
|
@ -14,12 +14,12 @@ f7455776936492ce7b241f9801d6bbc946b0461a SOURCES/pcs-web-ui-0.1.13.tar.gz
|
||||
bd18d97d611233914828719c97b4d98d079913d2 SOURCES/pcs-web-ui-node-modules-0.1.13.tar.xz
|
||||
3176b2f2b332c2b6bf79fe882e83feecf3d3f011 SOURCES/pyagentx-0.4.pcs.2.tar.gz
|
||||
c2ba10c775b7a52a4b57cac4d4110a0c0f812a82 SOURCES/python-dateutil-2.8.2.tar.gz
|
||||
d884e586767313f8fcf8c863b5220831a95fccb8 SOURCES/rack-2.2.4.gem
|
||||
312014942846897a363990784c3be291e66d38a2 SOURCES/rack-protection-2.2.3.gem
|
||||
3ad7b27b68d5dd893ce91f216bb2685ae6c9846a SOURCES/rack-2.2.5.gem
|
||||
5347315a7283f0b04443e924ed4eaa17807432c8 SOURCES/rack-protection-2.2.4.gem
|
||||
3c669527ecbcb9f915a83983ec89320c356e1fe3 SOURCES/rack-test-2.0.2.gem
|
||||
e7f48fa5fb2d92e6cb21d6b1638fe41a5a7c4287 SOURCES/rexml-3.2.5.gem
|
||||
d017b9e4d1978e0b3ccc3e2a31493809e4693cd3 SOURCES/ruby2_keywords-0.0.5.gem
|
||||
5bf6cbdabd03404a654e639b4e949705473c1050 SOURCES/sinatra-2.2.3.gem
|
||||
fa6a6c98f885e93f54c23dd0454cae906e82c31b SOURCES/sinatra-2.2.4.gem
|
||||
1ac6292a98e17247b7bb847a35ff868605256f7b SOURCES/thin-1.8.1.gem
|
||||
360d77c80d2851a538fb13d43751093115c34712 SOURCES/tilt-2.0.11.gem
|
||||
c23c617c7a0205e465bebad5b8cdf289ae8402a2 SOURCES/tornado-6.1.0.tar.gz
|
||||
|
@ -1,34 +1,16 @@
|
||||
From 2a3747fedeae228345c4ee74ce8ad6d72e297525 Mon Sep 17 00:00:00 2001
|
||||
From 0da95a7f05ae7600eebe30df78a3d4622cd6b4f8 Mon Sep 17 00:00:00 2001
|
||||
From: Ondrej Mular <omular@redhat.com>
|
||||
Date: Wed, 7 Dec 2022 15:53:25 +0100
|
||||
Subject: [PATCH 2/2] fix displaying bool and integer values in `pcs resource
|
||||
Subject: [PATCH 2/5] fix displaying bool and integer values in `pcs resource
|
||||
config` command
|
||||
|
||||
---
|
||||
CHANGELOG.md | 6 ++++++
|
||||
pcs/cli/resource/output.py | 18 +++++++++---------
|
||||
pcs_test/resources/cib-resources.xml | 2 +-
|
||||
pcs_test/tier1/legacy/test_resource.py | 3 ++-
|
||||
pcs_test/tools/resources_dto.py | 4 ++--
|
||||
5 files changed, 20 insertions(+), 13 deletions(-)
|
||||
4 files changed, 14 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/CHANGELOG.md b/CHANGELOG.md
|
||||
index 75d50acd..b4d64578 100644
|
||||
--- a/CHANGELOG.md
|
||||
+++ b/CHANGELOG.md
|
||||
@@ -7,6 +7,12 @@
|
||||
self-validation feature when the resource is already misconfigured
|
||||
([rhbz#2151511])
|
||||
|
||||
+### Fixed
|
||||
+- Displaying bool and integer values in `pcs resource config` command
|
||||
+ ([rhbz#2151166], [ghissue#604])
|
||||
+
|
||||
+[ghissue#604]: https://github.com/ClusterLabs/pcs/issues/604
|
||||
+[rhbz#2151166]: https://bugzilla.redhat.com/show_bug.cgi?id=2151166
|
||||
[rhbz#2151511]: https://bugzilla.redhat.com/show_bug.cgi?id=2151511
|
||||
|
||||
|
||||
diff --git a/pcs/cli/resource/output.py b/pcs/cli/resource/output.py
|
||||
index 6d1fad16..0705d27b 100644
|
||||
--- a/pcs/cli/resource/output.py
|
||||
@ -142,5 +124,5 @@ index 8f46f6dd..a980ec80 100644
|
||||
on_fail=None,
|
||||
meta_attributes=[],
|
||||
--
|
||||
2.38.1
|
||||
2.39.0
|
||||
|
||||
|
@ -1,10 +1,9 @@
|
||||
From fc2cc9c30dbe3559b4989acda32f8a8613ee5c16 Mon Sep 17 00:00:00 2001
|
||||
From 58589e47f2913276ea1c2164a3ce8ee694fb2b78 Mon Sep 17 00:00:00 2001
|
||||
From: Ondrej Mular <omular@redhat.com>
|
||||
Date: Wed, 7 Dec 2022 11:33:25 +0100
|
||||
Subject: [PATCH 1/2] add warning when updating a misconfigured resource
|
||||
Subject: [PATCH 1/5] add warning when updating a misconfigured resource
|
||||
|
||||
---
|
||||
CHANGELOG.md | 10 +++
|
||||
pcs/common/reports/codes.py | 3 +
|
||||
pcs/common/reports/messages.py | 19 +++++
|
||||
pcs/lib/cib/resource/primitive.py | 84 ++++++++++++++-----
|
||||
@ -13,28 +12,8 @@ Subject: [PATCH 1/2] add warning when updating a misconfigured resource
|
||||
.../cib/resource/test_primitive_validate.py | 56 +++++++------
|
||||
pcs_test/tier0/lib/pacemaker/test_live.py | 78 +++++------------
|
||||
pcs_test/tier1/legacy/test_stonith.py | 5 +-
|
||||
9 files changed, 171 insertions(+), 138 deletions(-)
|
||||
8 files changed, 161 insertions(+), 138 deletions(-)
|
||||
|
||||
diff --git a/CHANGELOG.md b/CHANGELOG.md
|
||||
index 2af6bee1..75d50acd 100644
|
||||
--- a/CHANGELOG.md
|
||||
+++ b/CHANGELOG.md
|
||||
@@ -1,5 +1,15 @@
|
||||
# Change Log
|
||||
|
||||
+## [Unreleased]
|
||||
+
|
||||
+### Added
|
||||
+- Warning to `pcs resource|stonith update` commands about not using agent
|
||||
+ self-validation feature when the resource is already misconfigured
|
||||
+ ([rhbz#2151511])
|
||||
+
|
||||
+[rhbz#2151511]: https://bugzilla.redhat.com/show_bug.cgi?id=2151511
|
||||
+
|
||||
+
|
||||
## [0.10.15] - 2022-11-23
|
||||
|
||||
### Security
|
||||
diff --git a/pcs/common/reports/codes.py b/pcs/common/reports/codes.py
|
||||
index deecc626..48048af7 100644
|
||||
--- a/pcs/common/reports/codes.py
|
||||
@ -749,5 +728,5 @@ index 9911d604..cf430d75 100644
|
||||
self.assert_pcs_success(
|
||||
"stonith config test2".split(),
|
||||
--
|
||||
2.38.1
|
||||
2.39.0
|
||||
|
||||
|
@ -0,0 +1,485 @@
|
||||
From 5bed788246ac19c866a60ab3773d94fa4ca28c37 Mon Sep 17 00:00:00 2001
|
||||
From: Miroslav Lisik <mlisik@redhat.com>
|
||||
Date: Thu, 5 Jan 2023 16:21:44 +0100
|
||||
Subject: [PATCH 5/5] Fix stonith-watchdog-timeout validation
|
||||
|
||||
---
|
||||
pcs/lib/cluster_property.py | 25 ++++-
|
||||
pcs/lib/sbd.py | 15 ++-
|
||||
.../lib/commands/test_cluster_property.py | 50 ++++++++--
|
||||
pcs_test/tier0/lib/test_cluster_property.py | 98 ++++++++++++++-----
|
||||
pcs_test/tier1/test_cluster_property.py | 14 ++-
|
||||
5 files changed, 157 insertions(+), 45 deletions(-)
|
||||
|
||||
diff --git a/pcs/lib/cluster_property.py b/pcs/lib/cluster_property.py
|
||||
index 9ccacd74..b622bdaf 100644
|
||||
--- a/pcs/lib/cluster_property.py
|
||||
+++ b/pcs/lib/cluster_property.py
|
||||
@@ -8,6 +8,7 @@ from lxml.etree import _Element
|
||||
|
||||
from pcs.common import reports
|
||||
from pcs.common.services.interfaces import ServiceManagerInterface
|
||||
+from pcs.common.tools import timeout_to_seconds
|
||||
from pcs.common.types import StringSequence
|
||||
from pcs.lib import (
|
||||
sbd,
|
||||
@@ -38,8 +39,21 @@ def _validate_stonith_watchdog_timeout_property(
|
||||
force: bool = False,
|
||||
) -> reports.ReportItemList:
|
||||
report_list: reports.ReportItemList = []
|
||||
+ original_value = value
|
||||
+ # if value is not empty, try to convert time interval string
|
||||
+ if value:
|
||||
+ seconds = timeout_to_seconds(value)
|
||||
+ if seconds is None:
|
||||
+ # returns empty list because this should be reported by
|
||||
+ # ValueTimeInterval validator
|
||||
+ return report_list
|
||||
+ value = str(seconds)
|
||||
if sbd.is_sbd_enabled(service_manager):
|
||||
- report_list.extend(sbd.validate_stonith_watchdog_timeout(value, force))
|
||||
+ report_list.extend(
|
||||
+ sbd.validate_stonith_watchdog_timeout(
|
||||
+ validate.ValuePair(original_value, value), force
|
||||
+ )
|
||||
+ )
|
||||
else:
|
||||
if value not in ["", "0"]:
|
||||
report_list.append(
|
||||
@@ -124,9 +138,6 @@ def validate_set_cluster_properties(
|
||||
# unknow properties are reported by NamesIn validator
|
||||
continue
|
||||
property_metadata = possible_properties_dict[property_name]
|
||||
- if property_metadata.name == "stonith-watchdog-timeout":
|
||||
- # needs extra validation
|
||||
- continue
|
||||
if property_metadata.type == "boolean":
|
||||
validators.append(
|
||||
validate.ValuePcmkBoolean(
|
||||
@@ -154,9 +165,13 @@ def validate_set_cluster_properties(
|
||||
)
|
||||
)
|
||||
elif property_metadata.type == "time":
|
||||
+ # make stonith-watchdog-timeout value not forcable
|
||||
validators.append(
|
||||
validate.ValueTimeInterval(
|
||||
- property_metadata.name, severity=severity
|
||||
+ property_metadata.name,
|
||||
+ severity=severity
|
||||
+ if property_metadata.name != "stonith-watchdog-timeout"
|
||||
+ else reports.ReportItemSeverity.error(),
|
||||
)
|
||||
)
|
||||
report_list.extend(
|
||||
diff --git a/pcs/lib/sbd.py b/pcs/lib/sbd.py
|
||||
index 1e3cfb37..38cd8767 100644
|
||||
--- a/pcs/lib/sbd.py
|
||||
+++ b/pcs/lib/sbd.py
|
||||
@@ -1,6 +1,9 @@
|
||||
import re
|
||||
from os import path
|
||||
-from typing import Optional
|
||||
+from typing import (
|
||||
+ Optional,
|
||||
+ Union,
|
||||
+)
|
||||
|
||||
from pcs import settings
|
||||
from pcs.common import reports
|
||||
@@ -392,7 +395,10 @@ def _get_local_sbd_watchdog_timeout() -> int:
|
||||
|
||||
|
||||
def validate_stonith_watchdog_timeout(
|
||||
- stonith_watchdog_timeout: str, force: bool = False
|
||||
+ stonith_watchdog_timeout: Union[
|
||||
+ validate.TypeOptionValue, validate.ValuePair
|
||||
+ ],
|
||||
+ force: bool = False,
|
||||
) -> reports.ReportItemList:
|
||||
"""
|
||||
Check sbd status and config when user is setting stonith-watchdog-timeout
|
||||
@@ -401,6 +407,7 @@ def validate_stonith_watchdog_timeout(
|
||||
|
||||
stonith_watchdog_timeout -- value to be validated
|
||||
"""
|
||||
+ stonith_watchdog_timeout = validate.ValuePair.get(stonith_watchdog_timeout)
|
||||
severity = reports.get_severity(reports.codes.FORCE, force)
|
||||
if _is_device_set_local():
|
||||
return (
|
||||
@@ -412,11 +419,11 @@ def validate_stonith_watchdog_timeout(
|
||||
),
|
||||
)
|
||||
]
|
||||
- if stonith_watchdog_timeout not in ["", "0"]
|
||||
+ if stonith_watchdog_timeout.normalized not in ["", "0"]
|
||||
else []
|
||||
)
|
||||
|
||||
- if stonith_watchdog_timeout in ["", "0"]:
|
||||
+ if stonith_watchdog_timeout.normalized in ["", "0"]:
|
||||
return [
|
||||
reports.ReportItem(
|
||||
severity,
|
||||
diff --git a/pcs_test/tier0/lib/commands/test_cluster_property.py b/pcs_test/tier0/lib/commands/test_cluster_property.py
|
||||
index 319d1df6..fd124843 100644
|
||||
--- a/pcs_test/tier0/lib/commands/test_cluster_property.py
|
||||
+++ b/pcs_test/tier0/lib/commands/test_cluster_property.py
|
||||
@@ -120,6 +120,34 @@ class StonithWatchdogTimeoutMixin(LoadMetadataMixin):
|
||||
)
|
||||
self.env_assist.assert_reports([])
|
||||
|
||||
+ def _set_invalid_value(self, forced=False):
|
||||
+ self.config.remove("services.is_enabled")
|
||||
+ self.env_assist.assert_raise_library_error(
|
||||
+ lambda: cluster_property.set_properties(
|
||||
+ self.env_assist.get_env(),
|
||||
+ {"stonith-watchdog-timeout": "15x"},
|
||||
+ [] if not forced else [reports.codes.FORCE],
|
||||
+ )
|
||||
+ )
|
||||
+ self.env_assist.assert_reports(
|
||||
+ [
|
||||
+ fixture.error(
|
||||
+ reports.codes.INVALID_OPTION_VALUE,
|
||||
+ option_name="stonith-watchdog-timeout",
|
||||
+ option_value="15x",
|
||||
+ allowed_values="time interval (e.g. 1, 2s, 3m, 4h, ...)",
|
||||
+ cannot_be_empty=False,
|
||||
+ forbidden_characters=None,
|
||||
+ ),
|
||||
+ ]
|
||||
+ )
|
||||
+
|
||||
+ def test_set_invalid_value(self):
|
||||
+ self._set_invalid_value(forced=False)
|
||||
+
|
||||
+ def test_set_invalid_value_forced(self):
|
||||
+ self._set_invalid_value(forced=True)
|
||||
+
|
||||
|
||||
class TestSetStonithWatchdogTimeoutSBDIsDisabled(
|
||||
StonithWatchdogTimeoutMixin, TestCase
|
||||
@@ -132,6 +160,9 @@ class TestSetStonithWatchdogTimeoutSBDIsDisabled(
|
||||
def test_set_zero(self):
|
||||
self._set_success({"stonith-watchdog-timeout": "0"})
|
||||
|
||||
+ def test_set_zero_time_suffix(self):
|
||||
+ self._set_success({"stonith-watchdog-timeout": "0s"})
|
||||
+
|
||||
def test_set_not_zero_or_empty(self):
|
||||
self.env_assist.assert_raise_library_error(
|
||||
lambda: cluster_property.set_properties(
|
||||
@@ -231,12 +262,12 @@ class TestSetStonithWatchdogTimeoutSBDIsEnabledWatchdogOnly(
|
||||
def test_set_zero_forced(self):
|
||||
self.config.env.push_cib(
|
||||
crm_config=fixture_crm_config_properties(
|
||||
- [("cib-bootstrap-options", {"stonith-watchdog-timeout": "0"})]
|
||||
+ [("cib-bootstrap-options", {"stonith-watchdog-timeout": "0s"})]
|
||||
)
|
||||
)
|
||||
cluster_property.set_properties(
|
||||
self.env_assist.get_env(),
|
||||
- {"stonith-watchdog-timeout": "0"},
|
||||
+ {"stonith-watchdog-timeout": "0s"},
|
||||
[reports.codes.FORCE],
|
||||
)
|
||||
self.env_assist.assert_reports(
|
||||
@@ -271,7 +302,7 @@ class TestSetStonithWatchdogTimeoutSBDIsEnabledWatchdogOnly(
|
||||
self.env_assist.assert_raise_library_error(
|
||||
lambda: cluster_property.set_properties(
|
||||
self.env_assist.get_env(),
|
||||
- {"stonith-watchdog-timeout": "9"},
|
||||
+ {"stonith-watchdog-timeout": "9s"},
|
||||
[],
|
||||
)
|
||||
)
|
||||
@@ -281,7 +312,7 @@ class TestSetStonithWatchdogTimeoutSBDIsEnabledWatchdogOnly(
|
||||
reports.codes.STONITH_WATCHDOG_TIMEOUT_TOO_SMALL,
|
||||
force_code=reports.codes.FORCE,
|
||||
cluster_sbd_watchdog_timeout=10,
|
||||
- entered_watchdog_timeout="9",
|
||||
+ entered_watchdog_timeout="9s",
|
||||
)
|
||||
]
|
||||
)
|
||||
@@ -289,12 +320,12 @@ class TestSetStonithWatchdogTimeoutSBDIsEnabledWatchdogOnly(
|
||||
def test_too_small_forced(self):
|
||||
self.config.env.push_cib(
|
||||
crm_config=fixture_crm_config_properties(
|
||||
- [("cib-bootstrap-options", {"stonith-watchdog-timeout": "9"})]
|
||||
+ [("cib-bootstrap-options", {"stonith-watchdog-timeout": "9s"})]
|
||||
)
|
||||
)
|
||||
cluster_property.set_properties(
|
||||
self.env_assist.get_env(),
|
||||
- {"stonith-watchdog-timeout": "9"},
|
||||
+ {"stonith-watchdog-timeout": "9s"},
|
||||
[reports.codes.FORCE],
|
||||
)
|
||||
self.env_assist.assert_reports(
|
||||
@@ -302,13 +333,13 @@ class TestSetStonithWatchdogTimeoutSBDIsEnabledWatchdogOnly(
|
||||
fixture.warn(
|
||||
reports.codes.STONITH_WATCHDOG_TIMEOUT_TOO_SMALL,
|
||||
cluster_sbd_watchdog_timeout=10,
|
||||
- entered_watchdog_timeout="9",
|
||||
+ entered_watchdog_timeout="9s",
|
||||
)
|
||||
]
|
||||
)
|
||||
|
||||
def test_more_than_timeout(self):
|
||||
- self._set_success({"stonith-watchdog-timeout": "11"})
|
||||
+ self._set_success({"stonith-watchdog-timeout": "11s"})
|
||||
|
||||
|
||||
@mock.patch("pcs.lib.sbd.get_local_sbd_device_list", lambda: ["dev1", "dev2"])
|
||||
@@ -323,6 +354,9 @@ class TestSetStonithWatchdogTimeoutSBDIsEnabledSharedDevices(
|
||||
def test_set_to_zero(self):
|
||||
self._set_success({"stonith-watchdog-timeout": "0"})
|
||||
|
||||
+ def test_set_to_zero_time_suffix(self):
|
||||
+ self._set_success({"stonith-watchdog-timeout": "0min"})
|
||||
+
|
||||
def test_set_not_zero_or_empty(self):
|
||||
self.env_assist.assert_raise_library_error(
|
||||
lambda: cluster_property.set_properties(
|
||||
diff --git a/pcs_test/tier0/lib/test_cluster_property.py b/pcs_test/tier0/lib/test_cluster_property.py
|
||||
index 2feb728d..8d6f90b1 100644
|
||||
--- a/pcs_test/tier0/lib/test_cluster_property.py
|
||||
+++ b/pcs_test/tier0/lib/test_cluster_property.py
|
||||
@@ -83,6 +83,7 @@ FIXTURE_VALID_OPTIONS_DICT = {
|
||||
"integer_param": "10",
|
||||
"percentage_param": "20%",
|
||||
"select_param": "s3",
|
||||
+ "stonith-watchdog-timeout": "0",
|
||||
"time_param": "5min",
|
||||
}
|
||||
|
||||
@@ -96,6 +97,8 @@ FIXTURE_INVALID_OPTIONS_DICT = {
|
||||
"have-watchdog": "100",
|
||||
}
|
||||
|
||||
+STONITH_WATCHDOG_TIMEOUT_UNSET_VALUES = ["", "0", "0s"]
|
||||
+
|
||||
|
||||
def _fixture_parameter(name, param_type, default, enum_values):
|
||||
return ResourceAgentParameter(
|
||||
@@ -239,6 +242,7 @@ class TestValidateSetClusterProperties(TestCase):
|
||||
sbd_enabled=False,
|
||||
sbd_devices=False,
|
||||
force=False,
|
||||
+ valid_value=True,
|
||||
):
|
||||
self.mock_is_sbd_enabled.return_value = sbd_enabled
|
||||
self.mock_sbd_devices.return_value = ["devices"] if sbd_devices else []
|
||||
@@ -254,9 +258,13 @@ class TestValidateSetClusterProperties(TestCase):
|
||||
),
|
||||
expected_report_list,
|
||||
)
|
||||
- if "stonith-watchdog-timeout" in new_properties and (
|
||||
- new_properties["stonith-watchdog-timeout"]
|
||||
- or "stonith-watchdog-timeout" in configured_properties
|
||||
+ if (
|
||||
+ "stonith-watchdog-timeout" in new_properties
|
||||
+ and (
|
||||
+ new_properties["stonith-watchdog-timeout"]
|
||||
+ or "stonith-watchdog-timeout" in configured_properties
|
||||
+ )
|
||||
+ and valid_value
|
||||
):
|
||||
self.mock_is_sbd_enabled.assert_called_once_with(
|
||||
self.mock_service_manager
|
||||
@@ -266,7 +274,10 @@ class TestValidateSetClusterProperties(TestCase):
|
||||
if sbd_devices:
|
||||
self.mock_sbd_timeout.assert_not_called()
|
||||
else:
|
||||
- if new_properties["stonith-watchdog-timeout"] in ["", "0"]:
|
||||
+ if (
|
||||
+ new_properties["stonith-watchdog-timeout"]
|
||||
+ in STONITH_WATCHDOG_TIMEOUT_UNSET_VALUES
|
||||
+ ):
|
||||
self.mock_sbd_timeout.assert_not_called()
|
||||
else:
|
||||
self.mock_sbd_timeout.assert_called_once_with()
|
||||
@@ -280,6 +291,8 @@ class TestValidateSetClusterProperties(TestCase):
|
||||
self.mock_sbd_timeout.assert_not_called()
|
||||
|
||||
self.mock_is_sbd_enabled.reset_mock()
|
||||
+ self.mock_sbd_devices.reset_mock()
|
||||
+ self.mock_sbd_timeout.reset_mock()
|
||||
|
||||
def test_no_properties_to_set_or_unset(self):
|
||||
self.assert_validate_set(
|
||||
@@ -328,7 +341,7 @@ class TestValidateSetClusterProperties(TestCase):
|
||||
)
|
||||
|
||||
def test_unset_stonith_watchdog_timeout_sbd_disabled(self):
|
||||
- for value in ["0", ""]:
|
||||
+ for value in STONITH_WATCHDOG_TIMEOUT_UNSET_VALUES:
|
||||
with self.subTest(value=value):
|
||||
self.assert_validate_set(
|
||||
["stonith-watchdog-timeout"],
|
||||
@@ -349,22 +362,27 @@ class TestValidateSetClusterProperties(TestCase):
|
||||
)
|
||||
|
||||
def test_set_ok_stonith_watchdog_timeout_sbd_enabled_without_devices(self):
|
||||
- self.assert_validate_set(
|
||||
- [], {"stonith-watchdog-timeout": "15"}, [], sbd_enabled=True
|
||||
- )
|
||||
+ for value in ["15", "15s"]:
|
||||
+ with self.subTest(value=value):
|
||||
+ self.assert_validate_set(
|
||||
+ [],
|
||||
+ {"stonith-watchdog-timeout": value},
|
||||
+ [],
|
||||
+ sbd_enabled=True,
|
||||
+ )
|
||||
|
||||
def test_set_small_stonith_watchdog_timeout_sbd_enabled_without_devices(
|
||||
self,
|
||||
):
|
||||
self.assert_validate_set(
|
||||
[],
|
||||
- {"stonith-watchdog-timeout": "9"},
|
||||
+ {"stonith-watchdog-timeout": "9s"},
|
||||
[
|
||||
fixture.error(
|
||||
reports.codes.STONITH_WATCHDOG_TIMEOUT_TOO_SMALL,
|
||||
force_code=reports.codes.FORCE,
|
||||
cluster_sbd_watchdog_timeout=10,
|
||||
- entered_watchdog_timeout="9",
|
||||
+ entered_watchdog_timeout="9s",
|
||||
)
|
||||
],
|
||||
sbd_enabled=True,
|
||||
@@ -387,28 +405,54 @@ class TestValidateSetClusterProperties(TestCase):
|
||||
force=True,
|
||||
)
|
||||
|
||||
- def test_set_not_a_number_stonith_watchdog_timeout_sbd_enabled_without_devices(
|
||||
+ def _set_invalid_value_stonith_watchdog_timeout(
|
||||
+ self, sbd_enabled=False, sbd_devices=False
|
||||
+ ):
|
||||
+ for value in ["invalid", "10x"]:
|
||||
+ with self.subTest(value=value):
|
||||
+ self.assert_validate_set(
|
||||
+ [],
|
||||
+ {"stonith-watchdog-timeout": value},
|
||||
+ [
|
||||
+ fixture.error(
|
||||
+ reports.codes.INVALID_OPTION_VALUE,
|
||||
+ option_name="stonith-watchdog-timeout",
|
||||
+ option_value=value,
|
||||
+ allowed_values="time interval (e.g. 1, 2s, 3m, 4h, ...)",
|
||||
+ cannot_be_empty=False,
|
||||
+ forbidden_characters=None,
|
||||
+ )
|
||||
+ ],
|
||||
+ sbd_enabled=sbd_enabled,
|
||||
+ sbd_devices=sbd_devices,
|
||||
+ valid_value=False,
|
||||
+ )
|
||||
+
|
||||
+ def test_set_invalid_value_stonith_watchdog_timeout_sbd_enabled_without_devices(
|
||||
self,
|
||||
):
|
||||
+ self._set_invalid_value_stonith_watchdog_timeout(
|
||||
+ sbd_enabled=True, sbd_devices=False
|
||||
+ )
|
||||
|
||||
- self.assert_validate_set(
|
||||
- [],
|
||||
- {"stonith-watchdog-timeout": "invalid"},
|
||||
- [
|
||||
- fixture.error(
|
||||
- reports.codes.STONITH_WATCHDOG_TIMEOUT_TOO_SMALL,
|
||||
- force_code=reports.codes.FORCE,
|
||||
- cluster_sbd_watchdog_timeout=10,
|
||||
- entered_watchdog_timeout="invalid",
|
||||
- )
|
||||
- ],
|
||||
- sbd_enabled=True,
|
||||
+ def test_set_invalid_value_stonith_watchdog_timeout_sbd_enabled_with_devices(
|
||||
+ self,
|
||||
+ ):
|
||||
+ self._set_invalid_value_stonith_watchdog_timeout(
|
||||
+ sbd_enabled=True, sbd_devices=True
|
||||
+ )
|
||||
+
|
||||
+ def test_set_invalid_value_stonith_watchdog_timeout_sbd_disabled(
|
||||
+ self,
|
||||
+ ):
|
||||
+ self._set_invalid_value_stonith_watchdog_timeout(
|
||||
+ sbd_enabled=False, sbd_devices=False
|
||||
)
|
||||
|
||||
def test_unset_stonith_watchdog_timeout_sbd_enabled_without_devices(
|
||||
self,
|
||||
):
|
||||
- for value in ["0", ""]:
|
||||
+ for value in STONITH_WATCHDOG_TIMEOUT_UNSET_VALUES:
|
||||
with self.subTest(value=value):
|
||||
self.assert_validate_set(
|
||||
["stonith-watchdog-timeout"],
|
||||
@@ -426,7 +470,7 @@ class TestValidateSetClusterProperties(TestCase):
|
||||
def test_unset_stonith_watchdog_timeout_sbd_enabled_without_devices_forced(
|
||||
self,
|
||||
):
|
||||
- for value in ["0", ""]:
|
||||
+ for value in STONITH_WATCHDOG_TIMEOUT_UNSET_VALUES:
|
||||
with self.subTest(value=value):
|
||||
self.assert_validate_set(
|
||||
["stonith-watchdog-timeout"],
|
||||
@@ -459,7 +503,7 @@ class TestValidateSetClusterProperties(TestCase):
|
||||
def test_set_stonith_watchdog_timeout_sbd_enabled_with_devices_forced(self):
|
||||
self.assert_validate_set(
|
||||
[],
|
||||
- {"stonith-watchdog-timeout": 15},
|
||||
+ {"stonith-watchdog-timeout": "15s"},
|
||||
[
|
||||
fixture.warn(
|
||||
reports.codes.STONITH_WATCHDOG_TIMEOUT_CANNOT_BE_SET,
|
||||
@@ -472,7 +516,7 @@ class TestValidateSetClusterProperties(TestCase):
|
||||
)
|
||||
|
||||
def test_unset_stonith_watchdog_timeout_sbd_enabled_with_devices(self):
|
||||
- for value in ["0", ""]:
|
||||
+ for value in STONITH_WATCHDOG_TIMEOUT_UNSET_VALUES:
|
||||
with self.subTest(value=value):
|
||||
self.assert_validate_set(
|
||||
["stonith-watchdog-timeout"],
|
||||
diff --git a/pcs_test/tier1/test_cluster_property.py b/pcs_test/tier1/test_cluster_property.py
|
||||
index ff1f9cfb..51e25efc 100644
|
||||
--- a/pcs_test/tier1/test_cluster_property.py
|
||||
+++ b/pcs_test/tier1/test_cluster_property.py
|
||||
@@ -169,7 +169,7 @@ class TestPropertySet(PropertyMixin, TestCase):
|
||||
|
||||
def test_set_stonith_watchdog_timeout(self):
|
||||
self.assert_pcs_fail(
|
||||
- "property set stonith-watchdog-timeout=5".split(),
|
||||
+ "property set stonith-watchdog-timeout=5s".split(),
|
||||
stdout_full=(
|
||||
"Error: stonith-watchdog-timeout can only be unset or set to 0 "
|
||||
"while SBD is disabled\n"
|
||||
@@ -179,6 +179,18 @@ class TestPropertySet(PropertyMixin, TestCase):
|
||||
)
|
||||
self.assert_resources_xml_in_cib(UNCHANGED_CRM_CONFIG)
|
||||
|
||||
+ def test_set_stonith_watchdog_timeout_invalid_value(self):
|
||||
+ self.assert_pcs_fail(
|
||||
+ "property set stonith-watchdog-timeout=5x".split(),
|
||||
+ stdout_full=(
|
||||
+ "Error: '5x' is not a valid stonith-watchdog-timeout value, use"
|
||||
+ " time interval (e.g. 1, 2s, 3m, 4h, ...)\n"
|
||||
+ "Error: Errors have occurred, therefore pcs is unable to "
|
||||
+ "continue\n"
|
||||
+ ),
|
||||
+ )
|
||||
+ self.assert_resources_xml_in_cib(UNCHANGED_CRM_CONFIG)
|
||||
+
|
||||
|
||||
class TestPropertyUnset(PropertyMixin, TestCase):
|
||||
def test_success(self):
|
||||
--
|
||||
2.39.0
|
||||
|
1438
SOURCES/bz2159455-01-add-agent-validation-option.patch
Normal file
1438
SOURCES/bz2159455-01-add-agent-validation-option.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
From 38333342cb0e931b11bbf57ba469b47172221a32 Mon Sep 17 00:00:00 2001
|
||||
From 91d13a82a0803f2a4653a2ec9379a27f4555dcb5 Mon Sep 17 00:00:00 2001
|
||||
From: Mamoru TASAKA <mtasaka@fedoraproject.org>
|
||||
Date: Thu, 8 Dec 2022 22:47:59 +0900
|
||||
Subject: [PATCH] pcsd ruby: adjust to json 2.6.3 error message change
|
||||
Subject: [PATCH 3/5] pcsd ruby: adjust to json 2.6.3 error message change
|
||||
|
||||
json 2.6.3 now removes line number information from parser
|
||||
error message.
|
||||
@ -36,5 +36,5 @@ index 7aaf4349..a580b24f 100644
|
||||
)
|
||||
assert_empty_data(cfg)
|
||||
--
|
||||
2.38.1
|
||||
2.39.0
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
Name: pcs
|
||||
Version: 0.10.15
|
||||
Release: 2%{?dist}
|
||||
Release: 3%{?dist}
|
||||
# https://docs.fedoraproject.org/en-US/packaging-guidelines/LicensingGuidelines/
|
||||
# https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses
|
||||
# GPL-2.0-only: pcs
|
||||
@ -43,12 +43,12 @@ ExclusiveArch: i686 x86_64 s390x ppc64le aarch64
|
||||
%global version_rubygem_json 2.6.3
|
||||
%global version_rubygem_mustermann 2.0.2
|
||||
%global version_rubygem_open4 1.3.4
|
||||
%global version_rubygem_rack 2.2.4
|
||||
%global version_rubygem_rack_protection 2.2.3
|
||||
%global version_rubygem_rack 2.2.5
|
||||
%global version_rubygem_rack_protection 2.2.4
|
||||
%global version_rubygem_rack_test 2.0.2
|
||||
%global version_rubygem_rexml 3.2.5
|
||||
%global version_rubygem_ruby2_keywords 0.0.5
|
||||
%global version_rubygem_sinatra 2.2.3
|
||||
%global version_rubygem_sinatra 2.2.4
|
||||
%global version_rubygem_thin 1.8.1
|
||||
%global version_rubygem_tilt 2.0.11
|
||||
|
||||
@ -125,6 +125,8 @@ Patch1: do-not-support-cluster-setup-with-udp-u-transport.patch
|
||||
Patch2: bz2151511-01-add-warning-when-updating-a-misconfigured-resource.patch
|
||||
Patch3: bz2151166-01-fix-displaying-bool-and-integer-values.patch
|
||||
Patch4: pcsd-rubygem-json-error-message-change.patch
|
||||
Patch5: bz2159455-01-add-agent-validation-option.patch
|
||||
Patch6: bz2158804-01-fix-stonith-watchdog-timeout-validation.patch
|
||||
|
||||
# Downstream patches do not come from upstream. They adapt pcs for specific
|
||||
# RHEL needs.
|
||||
@ -327,6 +329,8 @@ update_times_patch %{PATCH1}
|
||||
update_times_patch %{PATCH2}
|
||||
update_times_patch %{PATCH3}
|
||||
update_times_patch %{PATCH4}
|
||||
update_times_patch %{PATCH5}
|
||||
update_times_patch %{PATCH6}
|
||||
|
||||
# update_times_patch %{PATCH101}
|
||||
|
||||
@ -385,7 +389,7 @@ pwd
|
||||
cp -r %{_builddir}/%{ui_src_name}/build ${RPM_BUILD_ROOT}%{_libdir}/%{pcsd_public_dir}/ui
|
||||
|
||||
# prepare license files
|
||||
# some rubygems do not have a license file (ruby2_keywords, thin)
|
||||
# some rubygems do not have a license file (thin)
|
||||
mv %{rubygem_bundle_dir}/gems/backports-%{version_rubygem_backports}/LICENSE.txt backports_LICENSE.txt
|
||||
mv %{rubygem_bundle_dir}/gems/daemons-%{version_rubygem_daemons}/LICENSE daemons_LICENSE
|
||||
mv %{rubygem_bundle_dir}/gems/ethon-%{version_rubygem_ethon}/LICENSE ethon_LICENSE
|
||||
@ -400,6 +404,7 @@ mv %{rubygem_bundle_dir}/gems/open4-%{version_rubygem_open4}/LICENSE open4_LICEN
|
||||
mv %{rubygem_bundle_dir}/gems/rack-%{version_rubygem_rack}/MIT-LICENSE rack_MIT-LICENSE
|
||||
mv %{rubygem_bundle_dir}/gems/rack-protection-%{version_rubygem_rack_protection}/License rack-protection_License
|
||||
mv %{rubygem_bundle_dir}/gems/rack-test-%{version_rubygem_rack_test}/MIT-LICENSE.txt rack-test_MIT-LICENSE.txt
|
||||
mv %{rubygem_bundle_dir}/gems/ruby2_keywords-%{version_rubygem_ruby2_keywords}/LICENSE ruby2_keywords_LICENSE
|
||||
mv %{rubygem_bundle_dir}/gems/sinatra-%{version_rubygem_sinatra}/LICENSE sinatra_LICENSE
|
||||
mv %{rubygem_bundle_dir}/gems/tilt-%{version_rubygem_tilt}/COPYING tilt_COPYING
|
||||
|
||||
@ -535,6 +540,7 @@ remove_all_tests
|
||||
%license rack_MIT-LICENSE
|
||||
%license rack-protection_License
|
||||
%license rack-test_MIT-LICENSE.txt
|
||||
%license ruby2_keywords_LICENSE
|
||||
%license sinatra_LICENSE
|
||||
%license tilt_COPYING
|
||||
%{python3_sitelib}/*
|
||||
@ -577,6 +583,13 @@ remove_all_tests
|
||||
%license pyagentx_LICENSE.txt
|
||||
|
||||
%changelog
|
||||
* Mon Jan 16 2023 Michal Pospisil <mpospisi@redhat.com> - 0.10.15-3
|
||||
- Allow time values in stonith-watchdog-time property
|
||||
- Resource/stonith agent self-validation of instance attributes is now disabled by default, as many agents do not work with it properly
|
||||
- Updated bundled rubygems: rack, rack-protection, sinatra
|
||||
- Added license for ruby2_keywords
|
||||
- Resolves: rhbz#2158804 rhbz#2159455
|
||||
|
||||
* Fri Dec 16 2022 Michal Pospisil <mpospisi@redhat.com> - 0.10.15-2
|
||||
- Added warning when omitting validation of misconfigured resource
|
||||
- Fixed displaying of bool and integer values in `pcs resource config` command
|
||||
|
Loading…
Reference in New Issue
Block a user