import pcs-0.10.8-1.el8

This commit is contained in:
CentOS Sources 2021-05-18 02:55:32 -04:00 committed by Andrew Lukoshko
parent 7e86745340
commit fc10e85f5f
10 changed files with 87 additions and 9541 deletions

13
.gitignore vendored
View File

@ -1,18 +1,19 @@
SOURCES/HAM-logo.png
SOURCES/backports-3.17.2.gem
SOURCES/dacite-1.5.0.tar.gz
SOURCES/dacite-1.6.0.tar.gz
SOURCES/daemons-1.3.1.gem
SOURCES/dataclasses-0.6.tar.gz
SOURCES/dataclasses-0.8.tar.gz
SOURCES/ethon-0.12.0.gem
SOURCES/eventmachine-1.2.7.gem
SOURCES/ffi-1.13.1.gem
SOURCES/json-2.3.0.gem
SOURCES/mustermann-1.1.1.gem
SOURCES/open4-1.3.4-1.gem
SOURCES/pcs-0.10.6.tar.gz
SOURCES/pcs-web-ui-0.1.4.tar.gz
SOURCES/pcs-web-ui-node-modules-0.1.3.tar.xz
SOURCES/pcs-0.10.8.tar.gz
SOURCES/pcs-web-ui-0.1.5.tar.gz
SOURCES/pcs-web-ui-node-modules-0.1.5.tar.xz
SOURCES/pyagentx-0.4.pcs.2.tar.gz
SOURCES/python-dateutil-2.8.1.tar.gz
SOURCES/rack-2.2.3.gem
SOURCES/rack-protection-2.0.8.1.gem
SOURCES/rack-test-1.1.0.gem
@ -20,4 +21,4 @@ SOURCES/ruby2_keywords-0.0.2.gem
SOURCES/sinatra-2.0.8.1.gem
SOURCES/thin-1.7.2.gem
SOURCES/tilt-2.0.10.gem
SOURCES/tornado-6.0.4.tar.gz
SOURCES/tornado-6.1.0.tar.gz

View File

@ -1,18 +1,19 @@
679a4ce22a33ffd4d704261a17c00cff98d9499a SOURCES/HAM-logo.png
28b63a742124da6c9575a1c5e7d7331ef93600b2 SOURCES/backports-3.17.2.gem
c14ee49221d8e1b09364b5f248bc3da12484f675 SOURCES/dacite-1.5.0.tar.gz
31546c37fbdc6270d5097687619e9c0db6f1c05c SOURCES/dacite-1.6.0.tar.gz
e28c1e78d1a6e34e80f4933b494f1e0501939dd3 SOURCES/daemons-1.3.1.gem
81079b734108084eea0ae1c05a1cab0e806a3a1d SOURCES/dataclasses-0.6.tar.gz
8b7598273d2ae6dad2b88466aefac55071a41926 SOURCES/dataclasses-0.8.tar.gz
921ef1be44583a7644ee7f20fe5f26f21d018a04 SOURCES/ethon-0.12.0.gem
7a5b2896e210fac9759c786ee4510f265f75b481 SOURCES/eventmachine-1.2.7.gem
cfa25e7a3760c3ec16723cb8263d9b7a52d0eadf SOURCES/ffi-1.13.1.gem
0230e8c5a37f1543982e5b04be503dd5f9004b47 SOURCES/json-2.3.0.gem
50a4e37904485810cb05e27d75c9783e5a8f3402 SOURCES/mustermann-1.1.1.gem
41a7fe9f8e3e02da5ae76c821b89c5b376a97746 SOURCES/open4-1.3.4-1.gem
73fafb4228326c14a799f0cccbcb734ab7ba2bfa SOURCES/pcs-0.10.6.tar.gz
d67de4d5cefd9ba3cde45c7ec4a5d1e9b1e6032a SOURCES/pcs-web-ui-0.1.4.tar.gz
3e09042e3dc32c992451ba4c0454f2879f0d3f40 SOURCES/pcs-web-ui-node-modules-0.1.3.tar.xz
0e6b705715023ec5224ca05e977b8888f2a1b1e6 SOURCES/pcs-0.10.8.tar.gz
f23b14786b1911d498612bf0e90f344bcc4915c3 SOURCES/pcs-web-ui-0.1.5.tar.gz
57beab1c4bed96d7f9fc35261e96f78babb06980 SOURCES/pcs-web-ui-node-modules-0.1.5.tar.xz
3176b2f2b332c2b6bf79fe882e83feecf3d3f011 SOURCES/pyagentx-0.4.pcs.2.tar.gz
bd26127e57f83a10f656b62c46524c15aeb844dd SOURCES/python-dateutil-2.8.1.tar.gz
345b7169d4d2d62176a225510399963bad62b68f SOURCES/rack-2.2.3.gem
1f046e23baca8beece3b38c60382f44aa2b2cb41 SOURCES/rack-protection-2.0.8.1.gem
b80bc5ca38a885e747271675ba91dd3d02136bf1 SOURCES/rack-test-1.1.0.gem
@ -20,4 +21,4 @@ b80bc5ca38a885e747271675ba91dd3d02136bf1 SOURCES/rack-test-1.1.0.gem
04cca7a5d9d641fe076e4e24dc5b6ff31922f4c3 SOURCES/sinatra-2.0.8.1.gem
41395e86322ffd31f3a7aef1f697bda3e1e2d6b9 SOURCES/thin-1.7.2.gem
d265c822a6b228392d899e9eb5114613d65e6967 SOURCES/tilt-2.0.10.gem
e177f2a092dc5f23b0b3078e40adf52e17a9f8a6 SOURCES/tornado-6.0.4.tar.gz
c23c617c7a0205e465bebad5b8cdf289ae8402a2 SOURCES/tornado-6.1.0.tar.gz

View File

@ -1,57 +0,0 @@
From be40fe494ddeb4f7132389ca0f3c1193de0e425d Mon Sep 17 00:00:00 2001
From: Tomas Jelinek <tojeline@redhat.com>
Date: Tue, 23 Jun 2020 12:57:05 +0200
Subject: [PATCH 2/3] fix 'resource | stonith refresh' documentation
---
pcs/pcs.8 | 4 ++--
pcs/usage.py | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/pcs/pcs.8 b/pcs/pcs.8
index c887d332..3efc5bb2 100644
--- a/pcs/pcs.8
+++ b/pcs/pcs.8
@@ -325,7 +325,7 @@ If a node is not specified then resources / stonith devices on all nodes will be
refresh [<resource id>] [node=<node>] [\fB\-\-strict\fR]
Make the cluster forget the complete operation history (including failures) of the resource and re\-detect its current state. If you are interested in forgetting failed operations only, use the 'pcs resource cleanup' command.
.br
-If the named resource is part of a group, or one numbered instance of a clone or bundled resource, the clean\-up applies to the whole collective resource unless \fB\-\-strict\fR is given.
+If the named resource is part of a group, or one numbered instance of a clone or bundled resource, the refresh applies to the whole collective resource unless \fB\-\-strict\fR is given.
.br
If a resource id is not specified then all resources / stonith devices will be refreshed.
.br
@@ -613,7 +613,7 @@ If a node is not specified then resources / stonith devices on all nodes will be
refresh [<stonith id>] [\fB\-\-node\fR <node>] [\fB\-\-strict\fR]
Make the cluster forget the complete operation history (including failures) of the stonith device and re\-detect its current state. If you are interested in forgetting failed operations only, use the 'pcs stonith cleanup' command.
.br
-If the named stonith device is part of a group, or one numbered instance of a clone or bundled resource, the clean\-up applies to the whole collective resource unless \fB\-\-strict\fR is given.
+If the named stonith device is part of a group, or one numbered instance of a clone or bundled resource, the refresh applies to the whole collective resource unless \fB\-\-strict\fR is given.
.br
If a stonith id is not specified then all resources / stonith devices will be refreshed.
.br
diff --git a/pcs/usage.py b/pcs/usage.py
index 8722bd7b..0f3c95a3 100644
--- a/pcs/usage.py
+++ b/pcs/usage.py
@@ -663,7 +663,7 @@ Commands:
interested in forgetting failed operations only, use the 'pcs resource
cleanup' command.
If the named resource is part of a group, or one numbered instance of a
- clone or bundled resource, the clean-up applies to the whole collective
+ clone or bundled resource, the refresh applies to the whole collective
resource unless --strict is given.
If a resource id is not specified then all resources / stonith devices
will be refreshed.
@@ -1214,7 +1214,7 @@ Commands:
are interested in forgetting failed operations only, use the 'pcs
stonith cleanup' command.
If the named stonith device is part of a group, or one numbered
- instance of a clone or bundled resource, the clean-up applies to the
+ instance of a clone or bundled resource, the refresh applies to the
whole collective resource unless --strict is given.
If a stonith id is not specified then all resources / stonith devices
will be refreshed.
--
2.25.4

File diff suppressed because it is too large Load Diff

View File

@ -1,402 +0,0 @@
From 4a986e8ee0610b1c85a04e38042e4073d41207a4 Mon Sep 17 00:00:00 2001
From: Miroslav Lisik <mlisik@redhat.com>
Date: Mon, 13 Jul 2020 12:59:09 +0200
Subject: [PATCH 2/3] Fix tag removal in resource 'unclone/ungroup' commands
and extend test coverage
---
pcs/resource.py | 2 +-
.../tier1/cib_resource/test_clone_unclone.py | 73 +++++++--
.../tier1/cib_resource/test_group_ungroup.py | 143 +++++++++++++++---
pcs_test/tools/cib.py | 10 +-
4 files changed, 187 insertions(+), 41 deletions(-)
diff --git a/pcs/resource.py b/pcs/resource.py
index 9a3bd0ee..49d28ef0 100644
--- a/pcs/resource.py
+++ b/pcs/resource.py
@@ -2027,7 +2027,7 @@ def remove_resource_references(
if obj_ref.getAttribute("id") == resource_id:
tag = obj_ref.parentNode
tag.removeChild(obj_ref)
- if tag.getElementsByTagName(obj_ref).length == 0:
+ if tag.getElementsByTagName("obj_ref").length == 0:
remove_resource_references(
dom, tag.getAttribute("id"), output=output,
)
diff --git a/pcs_test/tier1/cib_resource/test_clone_unclone.py b/pcs_test/tier1/cib_resource/test_clone_unclone.py
index c9c6a29e..2633801a 100644
--- a/pcs_test/tier1/cib_resource/test_clone_unclone.py
+++ b/pcs_test/tier1/cib_resource/test_clone_unclone.py
@@ -55,6 +55,38 @@ FIXTURE_RESOURCES = """
)
+FIXTURE_CONSTRAINTS_CONFIG_XML = """
+ <constraints>
+ <rsc_location id="location-C-clone-rh7-1-INFINITY" node="rh7-1"
+ rsc="C-clone" score="INFINITY"/>
+ <rsc_location id="location-TagCloneOnly-rh7-1-INFINITY"
+ node="rh7-1" rsc="TagCloneOnly" score="INFINITY"/>
+ </constraints>
+"""
+
+
+FIXTURE_TAGS_CONFIG_XML = """
+ <tags>
+ <tag id="TagCloneOnly">
+ <obj_ref id="C-clone"/>
+ </tag>
+ <tag id="TagNotCloneOnly">
+ <obj_ref id="C-clone"/>
+ <obj_ref id="Dummy"/>
+ </tag>
+ </tags>
+"""
+
+
+FIXTURE_TAGS_RESULT_XML = """
+ <tags>
+ <tag id="TagNotCloneOnly">
+ <obj_ref id="Dummy"/>
+ </tag>
+ </tags>
+"""
+
+
class Unclone(
TestCase,
get_assert_pcs_effect_mixin(
@@ -66,6 +98,22 @@ class Unclone(
):
empty_cib = rc("cib-empty.xml")
+ def assert_tags_xml(self, expected_xml):
+ self.assert_resources_xml_in_cib(
+ expected_xml,
+ get_cib_part_func=lambda cib: etree.tostring(
+ etree.parse(cib).findall(".//tags")[0],
+ ),
+ )
+
+ def assert_constraint_xml(self, expected_xml):
+ self.assert_resources_xml_in_cib(
+ expected_xml,
+ get_cib_part_func=lambda cib: etree.tostring(
+ etree.parse(cib).findall(".//constraints")[0],
+ ),
+ )
+
def setUp(self):
# pylint: disable=invalid-name
self.temp_cib = get_tmp_file("tier1_cib_resource_group_ungroup")
@@ -75,18 +123,7 @@ class Unclone(
"resources", FIXTURE_CLONE, FIXTURE_DUMMY,
)
xml_manip.append_to_first_tag_name(
- "configuration",
- """
- <tags>
- <tag id="T1">
- <obj_ref id="C-clone"/>
- <obj_ref id="Dummy"/>
- </tag>
- <tag id="T2">
- <obj_ref id="C-clone"/>
- </tag>
- </tags>
- """,
+ "configuration", FIXTURE_TAGS_CONFIG_XML,
)
xml_manip.append_to_first_tag_name(
"constraints",
@@ -95,8 +132,8 @@ class Unclone(
rsc="C-clone" score="INFINITY"/>
""",
"""
- <rsc_location id="location-T1-rh7-1-INFINITY" node="rh7-1" rsc="T1"
- score="INFINITY"/>
+ <rsc_location id="location-TagCloneOnly-rh7-1-INFINITY"
+ node="rh7-1" rsc="TagCloneOnly" score="INFINITY"/>
""",
)
write_data_to_tmpfile(str(xml_manip), self.temp_cib)
@@ -111,6 +148,8 @@ class Unclone(
"Error: could not find resource: NonExistentClone\n",
)
self.assert_resources_xml_in_cib(FIXTURE_CLONE_AND_RESOURCE)
+ self.assert_tags_xml(FIXTURE_TAGS_CONFIG_XML)
+ self.assert_constraint_xml(FIXTURE_CONSTRAINTS_CONFIG_XML)
def test_not_clone_resource(self):
self.assert_pcs_fail(
@@ -118,9 +157,15 @@ class Unclone(
"Error: 'Dummy' is not a clone resource\n",
)
self.assert_resources_xml_in_cib(FIXTURE_CLONE_AND_RESOURCE)
+ self.assert_tags_xml(FIXTURE_TAGS_CONFIG_XML)
+ self.assert_constraint_xml(FIXTURE_CONSTRAINTS_CONFIG_XML)
def test_unclone_clone_id(self):
self.assert_effect("resource unclone C-clone", FIXTURE_RESOURCES)
+ self.assert_tags_xml(FIXTURE_TAGS_RESULT_XML)
+ self.assert_constraint_xml("<constraints/>")
def test_unclone_resoruce_id(self):
self.assert_effect("resource unclone C", FIXTURE_RESOURCES)
+ self.assert_tags_xml(FIXTURE_TAGS_RESULT_XML)
+ self.assert_constraint_xml("<constraints/>")
diff --git a/pcs_test/tier1/cib_resource/test_group_ungroup.py b/pcs_test/tier1/cib_resource/test_group_ungroup.py
index f86e9890..88cc315d 100644
--- a/pcs_test/tier1/cib_resource/test_group_ungroup.py
+++ b/pcs_test/tier1/cib_resource/test_group_ungroup.py
@@ -64,14 +64,63 @@ FIXTURE_AGROUP_XML = fixture_group_xml(
)
-class TestGroupMixin(
- get_assert_pcs_effect_mixin(
- lambda cib: etree.tostring(
- # pylint:disable=undefined-variable
- etree.parse(cib).findall(".//resources")[0]
- )
- ),
-):
+FIXTURE_CONSTRAINTS_CONFIG_XML = """
+ <constraints>
+ <rsc_location id="location-AGroup-rh7-1-INFINITY" node="rh7-1"
+ rsc="AGroup" score="INFINITY"/>
+ <rsc_location id="location-TagGroupOnly-rh7-1-INFINITY"
+ node="rh7-1" rsc="TagGroupOnly" score="INFINITY"/>
+ </constraints>
+"""
+
+FIXTURE_CLONE_TAG_CONSTRAINTS = """
+ <constraints>
+ <rsc_location id="location-AGroup-rh7-1-INFINITY" node="rh7-1"
+ rsc="AGroup-clone" score="INFINITY"
+ />
+ <rsc_location id="location-TagGroupOnly-rh7-1-INFINITY"
+ node="rh7-1" rsc="TagGroupOnly" score="INFINITY"
+ />
+ </constraints>
+"""
+
+
+FIXTURE_CLONE_CONSTRAINT = """
+ <constraints>
+ <rsc_location id="location-AGroup-rh7-1-INFINITY" node="rh7-1"
+ rsc="AGroup-clone" score="INFINITY"
+ />
+ </constraints>
+"""
+
+
+FIXTURE_TAGS_CONFIG_XML = """
+ <tags>
+ <tag id="TagGroupOnly">
+ <obj_ref id="AGroup"/>
+ </tag>
+ <tag id="TagNotGroupOnly">
+ <obj_ref id="AGroup"/>
+ <obj_ref id="A1"/>
+ <obj_ref id="A2"/>
+ <obj_ref id="A3"/>
+ </tag>
+ </tags>
+"""
+
+
+FIXTURE_TAGS_RESULT_XML = """
+ <tags>
+ <tag id="TagNotGroupOnly">
+ <obj_ref id="A1"/>
+ <obj_ref id="A2"/>
+ <obj_ref id="A3"/>
+ </tag>
+ </tags>
+"""
+
+
+class TestGroupMixin:
empty_cib = rc("cib-empty.xml")
def setUp(self):
@@ -81,17 +130,7 @@ class TestGroupMixin(
xml_manip = XmlManipulation.from_file(self.empty_cib)
xml_manip.append_to_first_tag_name("resources", FIXTURE_AGROUP_XML)
xml_manip.append_to_first_tag_name(
- "configuration",
- """
- <tags>
- <tag id="T1">
- <obj_ref id="AGroup"/>
- </tag>
- <tag id="T2">
- <obj_ref id="AGroup"/>
- </tag>
- </tags>
- """,
+ "configuration", FIXTURE_TAGS_CONFIG_XML,
)
xml_manip.append_to_first_tag_name(
"constraints",
@@ -100,8 +139,8 @@ class TestGroupMixin(
rsc="AGroup" score="INFINITY"/>
""",
"""
- <rsc_location id="location-T1-rh7-1-INFINITY" node="rh7-1" rsc="T1"
- score="INFINITY"/>
+ <rsc_location id="location-TagGroupOnly-rh7-1-INFINITY"
+ node="rh7-1" rsc="TagGroupOnly" score="INFINITY"/>
""",
)
write_data_to_tmpfile(str(xml_manip), self.temp_cib)
@@ -111,9 +150,33 @@ class TestGroupMixin(
self.temp_cib.close()
-class GroupDeleteRemoveUngroupBase(TestGroupMixin):
+class GroupDeleteRemoveUngroupBase(
+ get_assert_pcs_effect_mixin(
+ lambda cib: etree.tostring(
+ # pylint:disable=undefined-variable
+ etree.parse(cib).findall(".//resources")[0]
+ )
+ ),
+ TestGroupMixin,
+):
command = None
+ def assert_tags_xml(self, expected_xml):
+ self.assert_resources_xml_in_cib(
+ expected_xml,
+ get_cib_part_func=lambda cib: etree.tostring(
+ etree.parse(cib).findall(".//tags")[0],
+ ),
+ )
+
+ def assert_constraint_xml(self, expected_xml):
+ self.assert_resources_xml_in_cib(
+ expected_xml,
+ get_cib_part_func=lambda cib: etree.tostring(
+ etree.parse(cib).findall(".//constraints")[0],
+ ),
+ )
+
def test_nonexistent_group(self):
self.assert_pcs_fail(
f"resource {self.command} NonExistentGroup",
@@ -122,6 +185,8 @@ class GroupDeleteRemoveUngroupBase(TestGroupMixin):
self.assert_resources_xml_in_cib(
fixture_resources_xml([FIXTURE_AGROUP_XML]),
)
+ self.assert_tags_xml(FIXTURE_TAGS_CONFIG_XML)
+ self.assert_constraint_xml(FIXTURE_CONSTRAINTS_CONFIG_XML)
def test_not_a_group_id(self):
self.assert_pcs_fail(
@@ -130,6 +195,8 @@ class GroupDeleteRemoveUngroupBase(TestGroupMixin):
self.assert_resources_xml_in_cib(
fixture_resources_xml([FIXTURE_AGROUP_XML]),
)
+ self.assert_tags_xml(FIXTURE_TAGS_CONFIG_XML)
+ self.assert_constraint_xml(FIXTURE_CONSTRAINTS_CONFIG_XML)
def test_whole_group(self):
self.assert_effect(
@@ -142,10 +209,12 @@ class GroupDeleteRemoveUngroupBase(TestGroupMixin):
],
),
output=(
- "Removing Constraint - location-T1-rh7-1-INFINITY\n"
+ "Removing Constraint - location-TagGroupOnly-rh7-1-INFINITY\n"
"Removing Constraint - location-AGroup-rh7-1-INFINITY\n"
),
)
+ self.assert_tags_xml(FIXTURE_TAGS_RESULT_XML)
+ self.assert_constraint_xml("<constraints/>")
def test_specified_resources(self):
self.assert_effect(
@@ -160,6 +229,26 @@ class GroupDeleteRemoveUngroupBase(TestGroupMixin):
],
),
)
+ self.assert_tags_xml(FIXTURE_TAGS_CONFIG_XML)
+ self.assert_constraint_xml(FIXTURE_CONSTRAINTS_CONFIG_XML)
+
+ def test_all_resources(self):
+ self.assert_effect(
+ f"resource {self.command} AGroup A1 A2 A3",
+ fixture_resources_xml(
+ [
+ fixture_primitive_xml("A1"),
+ fixture_primitive_xml("A2"),
+ fixture_primitive_xml("A3"),
+ ],
+ ),
+ output=(
+ "Removing Constraint - location-TagGroupOnly-rh7-1-INFINITY\n"
+ "Removing Constraint - location-AGroup-rh7-1-INFINITY\n"
+ ),
+ )
+ self.assert_tags_xml(FIXTURE_TAGS_RESULT_XML)
+ self.assert_constraint_xml("<constraints/>")
def test_cloned_group(self):
self.assert_pcs_success("resource clone AGroup")
@@ -172,6 +261,8 @@ class GroupDeleteRemoveUngroupBase(TestGroupMixin):
[fixture_clone_xml("AGroup-clone", FIXTURE_AGROUP_XML)],
)
)
+ self.assert_tags_xml(FIXTURE_TAGS_CONFIG_XML)
+ self.assert_constraint_xml(FIXTURE_CLONE_TAG_CONSTRAINTS)
def test_cloned_group_all_resorces_specified(self):
self.assert_pcs_success("resource clone AGroup")
@@ -184,6 +275,8 @@ class GroupDeleteRemoveUngroupBase(TestGroupMixin):
[fixture_clone_xml("AGroup-clone", FIXTURE_AGROUP_XML)],
)
)
+ self.assert_tags_xml(FIXTURE_TAGS_CONFIG_XML)
+ self.assert_constraint_xml(FIXTURE_CLONE_TAG_CONSTRAINTS)
def test_cloned_group_with_one_resource(self):
self.assert_pcs_success("resource clone AGroup")
@@ -199,8 +292,10 @@ class GroupDeleteRemoveUngroupBase(TestGroupMixin):
fixture_primitive_xml("A2"),
],
),
- output="Removing Constraint - location-T1-rh7-1-INFINITY\n",
+ output="Removing Constraint - location-TagGroupOnly-rh7-1-INFINITY\n",
)
+ self.assert_tags_xml(FIXTURE_TAGS_RESULT_XML)
+ self.assert_constraint_xml(FIXTURE_CLONE_CONSTRAINT)
class ResourceUngroup(GroupDeleteRemoveUngroupBase, TestCase):
diff --git a/pcs_test/tools/cib.py b/pcs_test/tools/cib.py
index d52176cf..5eaaa92e 100644
--- a/pcs_test/tools/cib.py
+++ b/pcs_test/tools/cib.py
@@ -30,8 +30,14 @@ def xml_format(xml_string):
def get_assert_pcs_effect_mixin(get_cib_part):
class AssertPcsEffectMixin(AssertPcsMixin):
- def assert_resources_xml_in_cib(self, expected_xml_resources):
- xml = get_cib_part(self.temp_cib)
+ def assert_resources_xml_in_cib(
+ self, expected_xml_resources, get_cib_part_func=None,
+ ):
+ self.temp_cib.seek(0)
+ if get_cib_part_func is not None:
+ xml = get_cib_part_func(self.temp_cib)
+ else:
+ xml = get_cib_part(self.temp_cib)
try:
assert_xml_equal(expected_xml_resources, xml.decode())
except AssertionError as e:
--
2.25.4

View File

@ -1,80 +0,0 @@
From 85f8cbca6af296a5b8e4d43e9f56daed0d7c195b Mon Sep 17 00:00:00 2001
From: Tomas Jelinek <tojeline@redhat.com>
Date: Mon, 10 Aug 2020 12:17:01 +0200
Subject: [PATCH 1/2] rule: fix mixing 'and' and 'or' expressions
---
pcs/lib/cib/rule/parsed_to_cib.py | 5 +++++
pcs_test/tier0/lib/cib/rule/test_parsed_to_cib.py | 4 ++--
pcs_test/tier1/test_cib_options.py | 11 +++++++++--
3 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/pcs/lib/cib/rule/parsed_to_cib.py b/pcs/lib/cib/rule/parsed_to_cib.py
index 0fcae4f1..130663db 100644
--- a/pcs/lib/cib/rule/parsed_to_cib.py
+++ b/pcs/lib/cib/rule/parsed_to_cib.py
@@ -62,6 +62,11 @@ def __export_bool(
{
"id": create_subelement_id(parent_el, "rule", id_provider),
"boolean-op": boolean.operator.lower(),
+ # Score or score-attribute is required for nested rules, otherwise
+ # the CIB is not valid. Pacemaker doesn't use the score of nested
+ # rules. Score for the top rule, which is used by pacemaker, is
+ # supposed to be set in the export function above.
+ "score": "0",
},
)
for child in boolean.children:
diff --git a/pcs_test/tier0/lib/cib/rule/test_parsed_to_cib.py b/pcs_test/tier0/lib/cib/rule/test_parsed_to_cib.py
index f61fce99..fa639f7c 100644
--- a/pcs_test/tier0/lib/cib/rule/test_parsed_to_cib.py
+++ b/pcs_test/tier0/lib/cib/rule/test_parsed_to_cib.py
@@ -185,7 +185,7 @@ class Complex(Base):
),
"""
<rule id="X-rule" boolean-op="and" score="INFINITY">
- <rule id="X-rule-rule" boolean-op="or">
+ <rule id="X-rule-rule" boolean-op="or" score="0">
<rsc_expression id="X-rule-rule-rsc-ocf-pacemaker-Dummy"
class="ocf" provider="pacemaker" type="Dummy"
/>
@@ -197,7 +197,7 @@ class Complex(Base):
class="ocf" provider="heartbeat" type="Dummy"
/>
</rule>
- <rule id="X-rule-rule-1" boolean-op="or">
+ <rule id="X-rule-rule-1" boolean-op="or" score="0">
<op_expression id="X-rule-rule-1-op-monitor"
name="monitor" interval="30s"
/>
diff --git a/pcs_test/tier1/test_cib_options.py b/pcs_test/tier1/test_cib_options.py
index ba8f3515..92dbaed1 100644
--- a/pcs_test/tier1/test_cib_options.py
+++ b/pcs_test/tier1/test_cib_options.py
@@ -254,14 +254,21 @@ class OpDefaultsSetCreate(
self.assert_effect(
(
f"{self.cli_command} set create id=X meta nam1=val1 "
- "rule resource ::Dummy and op monitor"
+ "rule resource ::Dummy and (op start or op stop)"
),
f"""\
<{self.cib_tag}>
<meta_attributes id="X">
<rule id="X-rule" boolean-op="and" score="INFINITY">
<rsc_expression id="X-rule-rsc-Dummy" type="Dummy"/>
- <op_expression id="X-rule-op-monitor" name="monitor"/>
+ <rule id="X-rule-rule" boolean-op="or" score="0">
+ <op_expression id="X-rule-rule-op-start"
+ name="start"
+ />
+ <op_expression id="X-rule-rule-op-stop"
+ name="stop"
+ />
+ </rule>
</rule>
<nvpair id="X-nam1" name="nam1" value="val1"/>
</meta_attributes>
--
2.25.4

View File

@ -1,42 +0,0 @@
From e802f0c419ca3ff12a75045f57ed3ab535ff1c46 Mon Sep 17 00:00:00 2001
From: Tomas Jelinek <tojeline@redhat.com>
Date: Thu, 7 Jan 2021 16:33:12 +0100
Subject: [PATCH] remove unwanted logging to system log
In commit 966959ac54d80c4cdeeb0fac40dc7ea60c1a0a82, pcs/app.py got
imported into pcs/run.py. The intention was to unify running various pcs
parts (cli, daemon, snmp). This caused logging.basicConfigure() located
in app.py to be run every time run.py was executed. Due to this, pcs
daemon was configured to log to stderr. All those stderr logs were
propagated to system log by systemd / system logger.
---
pcs/app.py | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/pcs/app.py b/pcs/app.py
index 4806c2d0..c3de179b 100644
--- a/pcs/app.py
+++ b/pcs/app.py
@@ -111,7 +111,6 @@ def _non_root_run(argv_cmd):
sys.exit(exitcode)
-logging.basicConfig()
usefile = False
filename = ""
@@ -227,9 +226,8 @@ def main(argv=None):
).format(val)
)
- logger = logging.getLogger("pcs")
- logger.propagate = 0
- logger.handlers = []
+ # initialize logger
+ logging.getLogger("pcs")
if (os.getuid() != 0) and (argv and argv[0] != "help") and not usefile:
_non_root_run(argv)
--
2.26.2

View File

@ -1,7 +1,7 @@
From aaf5cbfcc661cedc49ae5d86c0d442502aa17231 Mon Sep 17 00:00:00 2001
From ab9fd9f223e805247319ac5a7318c15417197a0a Mon Sep 17 00:00:00 2001
From: Ivan Devat <idevat@redhat.com>
Date: Tue, 20 Nov 2018 15:03:56 +0100
Subject: [PATCH 2/2] do not support cluster setup with udp(u) transport
Subject: [PATCH] do not support cluster setup with udp(u) transport
---
pcs/pcs.8 | 2 ++
@ -10,10 +10,10 @@ Subject: [PATCH 2/2] do not support cluster setup with udp(u) transport
3 files changed, 6 insertions(+)
diff --git a/pcs/pcs.8 b/pcs/pcs.8
index 3efc5bb2..20247774 100644
index edfdd039..8caf087f 100644
--- a/pcs/pcs.8
+++ b/pcs/pcs.8
@@ -376,6 +376,8 @@ By default, encryption is enabled with cipher=aes256 and hash=sha256. To disable
@@ -424,6 +424,8 @@ By default, encryption is enabled with cipher=aes256 and hash=sha256. To disable
Transports udp and udpu:
.br
@ -23,10 +23,10 @@ index 3efc5bb2..20247774 100644
.br
Transport options are: ip_version, netmtu
diff --git a/pcs/usage.py b/pcs/usage.py
index 0f3c95a3..51bc1196 100644
index baedb347..f576eaf2 100644
--- a/pcs/usage.py
+++ b/pcs/usage.py
@@ -796,6 +796,7 @@ Commands:
@@ -852,6 +852,7 @@ Commands:
hash=sha256. To disable encryption, set cipher=none and hash=none.
Transports udp and udpu:
@ -49,5 +49,5 @@ index b857cbae..b8d48d92 100644
#csetup-transport-options.knet .without-knet
{
--
2.25.4
2.26.2

View File

@ -1,17 +1,18 @@
Name: pcs
Version: 0.10.6
Release: 4%{?dist}.1
Version: 0.10.8
Release: 1%{?dist}
# https://docs.fedoraproject.org/en-US/packaging-guidelines/LicensingGuidelines/
# https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses
# GPLv2: pcs
# ASL 2.0: dataclasses, tornado
# MIT: handlebars, backports, dacite, daemons, ethon, mustermann, rack,
# rack-protection, rack-test, sinatra, tilt
# ASL 2.0 or BSD: dateutil
# MIT: backports, dacite, daemons, ember, ethon, handlebars, jquery, jquery-ui,
# mustermann, rack, rack-protection, rack-test, sinatra, tilt
# GPLv2 or Ruby: eventmachne, json
# (GPLv2 or Ruby) and BSD: thin
# BSD or Ruby: open4, ruby2_keywords
# BSD and MIT: ffi
License: GPLv2 and ASL 2.0 and MIT and BSD and (GPLv2 or Ruby) and (BSD or Ruby)
License: GPLv2 and ASL 2.0 and MIT and BSD and (GPLv2 or Ruby) and (BSD or Ruby) and (ASL 2.0 or BSD)
URL: https://github.com/ClusterLabs/pcs
Group: System Environment/Base
Summary: Pacemaker Configuration System
@ -19,21 +20,22 @@ Summary: Pacemaker Configuration System
ExclusiveArch: i686 x86_64 s390x ppc64le aarch64
%global version_or_commit %{version}
# %%global version_or_commit 5c3f35d2819b0e8be0dcbe0ee8f81b9b24b20b54
# %%global version_or_commit 508b3999eb02b4901e83b8e780af8422b522ad30
%global pcs_source_name %{name}-%{version_or_commit}
# ui_commit can be determined by hash, tag or branch
%global ui_commit 0.1.4
%global ui_modules_version 0.1.3
# ui_commit can be determined by hash, tag or branch
%global ui_commit 0.1.5
%global ui_modules_version 0.1.5
%global ui_src_name pcs-web-ui-%{ui_commit}
%global pcs_snmp_pkg_name pcs-snmp
%global pyagentx_version 0.4.pcs.2
%global tornado_version 6.0.4
%global dataclasses_version 0.6
%global dacite_version 1.5.0
%global tornado_version 6.1.0
%global dataclasses_version 0.8
%global dacite_version 1.6.0
%global dateutil_version 2.8.1
%global version_rubygem_backports 3.17.2
%global version_rubygem_daemons 1.3.1
%global version_rubygem_ethon 0.12.0
@ -50,6 +52,12 @@ ExclusiveArch: i686 x86_64 s390x ppc64le aarch64
%global version_rubygem_thin 1.7.2
%global version_rubygem_tilt 2.0.10
# javascript bundled libraries for old web-ui
%global ember_version 1.4.0
%global handlebars_version 1.2.1
%global jquery_ui_version 1.10.1
%global jquery_version 1.9.1
# We do not use _libdir macro because upstream is not prepared for it.
# Pcs does not include binaries and thus it should live in /usr/lib. Tornado
# and gems include binaries and thus it should live in /usr/lib64. But the
@ -85,6 +93,7 @@ Source41: https://github.com/ondrejmular/pyagentx/archive/v%{pyagentx_version}/p
Source42: https://github.com/tornadoweb/tornado/archive/v%{tornado_version}/tornado-%{tornado_version}.tar.gz
Source43: https://github.com/ericvsmith/dataclasses/archive/%{dataclasses_version}/dataclasses-%{dataclasses_version}.tar.gz
Source44: https://github.com/konradhalas/dacite/archive/v%{dacite_version}/dacite-%{dacite_version}.tar.gz
Source45: https://github.com/dateutil/dateutil/archive/%{dateutil_version}/python-dateutil-%{dateutil_version}.tar.gz
Source81: https://rubygems.org/downloads/backports-%{version_rubygem_backports}.gem
Source82: https://rubygems.org/downloads/ethon-%{version_rubygem_ethon}.gem
@ -112,20 +121,14 @@ Source101: https://github.com/idevat/pcs-web-ui/releases/download/%{ui_modules_v
# They should come before downstream patches to avoid unnecessary conflicts.
# Z-streams are exception here: they can come from upstream but should be
# applied at the end to keep z-stream changes as straightforward as possible.
# Patch1: name.patch
Patch1: bz1817547-01-resource-and-operation-defaults.patch
Patch2: bz1805082-01-fix-resource-stonith-refresh-documentation.patch
Patch3: bz1843079-01-upgrade-CIB-schema-for-on-fail-demote.patch
Patch4: bz1857295-01-Fix-tag-removal-in-resource-unclone-ungroup-commands.patch
Patch5: bz1867516-01-rule-fix-mixing-and-and-or-expressions.patch
# Patch1: bzNUMBER-01-name.patch
# Downstream patches do not come from upstream. They adapt pcs for specific
# RHEL needs.
Patch101: do-not-support-cluster-setup-with-udp-u-transport.patch
Patch102: bz1919318-01-remove-unwanted-logging-to-system-log.patch
# git for patches
BuildRequires: git
BuildRequires: git-core
#printf from coreutils is used in makefile
BuildRequires: coreutils
# python for pcs
@ -134,6 +137,8 @@ BuildRequires: python3-devel
BuildRequires: platform-python-setuptools
BuildRequires: python3-pycurl
BuildRequires: python3-pyparsing
# for bundled python dateutil
BuildRequires: python3-setuptools_scm
# gcc for compiling custom rubygems
BuildRequires: gcc
BuildRequires: gcc-c++
@ -153,6 +158,7 @@ BuildRequires: python3-pyOpenSSL
# pcsd fonts and font management tools for creating symlinks to fonts
BuildRequires: fontconfig
BuildRequires: liberation-sans-fonts
BuildRequires: make
BuildRequires: overpass-fonts
# Red Hat logo for creating symlink of favicon
BuildRequires: redhat-logos
@ -200,6 +206,7 @@ Requires: logrotate
Provides: bundled(tornado) = %{tornado_version}
Provides: bundled(dataclasses) = %{dataclasses_version}
Provides: bundled(dacite) = %{dacite_version}
Provides: bundled(dateutil) = %{dateutil_version}
Provides: bundled(backports) = %{version_rubygem_backports}
Provides: bundled(daemons) = %{version_rubygem_daemons}
Provides: bundled(ethon) = %{version_rubygem_ethon}
@ -216,6 +223,12 @@ Provides: bundled(sinatra) = %{version_rubygem_sinatra}
Provides: bundled(thin) = %{version_rubygem_thin}
Provides: bundled(tilt) = %{version_rubygem_tilt}
# javascript bundled libraries for old web-ui
Provides: bundled(ember) = %{ember_version}
Provides: bundled(handlebars) = %{handlebars_version}
Provides: bundled(jquery) = %{jquery_version}
Provides: bundled(jquery-ui) = %{jquery_ui_version}
%description
pcs is a corosync and pacemaker configuration tool. It permits users to
easily view, modify and create pacemaker based clusters.
@ -285,13 +298,7 @@ update_times_patch(){
}
# update_times_patch %%{PATCH1}
update_times_patch %{PATCH1}
update_times_patch %{PATCH2}
update_times_patch %{PATCH3}
update_times_patch %{PATCH4}
update_times_patch %{PATCH5}
update_times_patch %{PATCH101}
update_times_patch %{PATCH102}
cp -f %SOURCE1 pcsd/public/images
# prepare dirs/files necessary for building web ui
@ -358,6 +365,13 @@ update_times %SOURCE44 `find %{bundled_src_dir}/dacite -follow`
cp %{bundled_src_dir}/dacite/LICENSE dacite_LICENSE
cp %{bundled_src_dir}/dacite/README.md dacite_README.md
# 8) sources for python dateutil
tar -xzf %SOURCE45 -C %{bundled_src_dir}
mv %{bundled_src_dir}/python-dateutil-%{dateutil_version} %{bundled_src_dir}/python-dateutil
update_times %SOURCE45 `find %{bundled_src_dir}/python-dateutil -follow`
cp %{bundled_src_dir}/python-dateutil/LICENSE dateutil_LICENSE
cp %{bundled_src_dir}/python-dateutil/README.rst dateutil_README.rst
%build
%define debug_package %{nil}
@ -429,6 +443,7 @@ make install \
BUNDLE_PYAGENTX_SRC_DIR=`readlink -f %{bundled_src_dir}/pyagentx` \
BUNDLE_TORNADO_SRC_DIR=`readlink -f %{bundled_src_dir}/tornado` \
BUNDLE_DACITE_SRC_DIR=`readlink -f %{bundled_src_dir}/dacite` \
BUNDLE_DATEUTIL_SRC_DIR=`readlink -f %{bundled_src_dir}/python-dateutil` \
BUNDLE_DATACLASSES_SRC_DIR=`readlink -f %{bundled_src_dir}/dataclasses` \
BUILD_GEMS=false \
SYSTEMCTL_OVERRIDE=true \
@ -548,9 +563,11 @@ remove_all_tests
%doc README.md
%doc tornado_README.rst
%doc dacite_README.md
%doc dateutil_README.rst
%doc dataclasses_README.rst
%license tornado_LICENSE
%license dacite_LICENSE
%license dateutil_LICENSE
%license dataclasses_LICENSE.txt
%license COPYING
# rugygem licenses
@ -580,6 +597,8 @@ remove_all_tests
%{pcs_libdir}/pcs/bundled/packages/tornado*
%{pcs_libdir}/pcs/bundled/packages/dacite*
%{pcs_libdir}/pcs/bundled/packages/dataclasses*
%{pcs_libdir}/pcs/bundled/packages/dateutil*
%{pcs_libdir}/pcs/bundled/packages/python_dateutil*
%{pcs_libdir}/pcs/bundled/packages/__pycache__/dataclasses.cpython-36.pyc
%{_unitdir}/pcsd.service
%{_unitdir}/pcsd-ruby.service
@ -625,9 +644,27 @@ remove_all_tests
%license pyagentx_LICENSE.txt
%changelog
* Mon Feb 08 2021 Miroslav Lisik <mlisik@redhat.com> - 0.10.6-4.el8_3.1
- Remove unwanted logging to system log
- Resolves: rhbz#1919318
* Mon Feb 01 2021 Miroslav Lisik <mlisik@redhat.com> - 0.10.8-1
- Rebased to latest upstream sources (see CHANGELOG.md)
- Updated pcs-web-ui
- Updated python bundled dependencies: dacite, dataclasses
- Resolves: rhbz#1457314 rhbz#1619818 rhbz#1667066 rhbz#1762816 rhbz#1794062 rhbz#1845470 rhbz#1856397 rhbz#1877762 rhbz#1917286
* Thu Dec 17 2020 Miroslav Lisik <mlisik@redhat.com> - 0.10.7-3
- Rebased to latest upstream sources (see CHANGELOG.md)
- Add BuildRequires: make
- Resolves: rhbz#1667061 rhbz#1667066 rhbz#1774143 rhbz#1885658
* Fri Nov 13 2020 Miroslav Lisik <mlisik@redhat.com> - 0.10.7-2
- Rebased to latest upstream sources (see CHANGELOG.md)
- Changed BuildRequires from git to git-core
- Resolves: rhbz#1869399 rhbz#1885658 rhbz#1896379
* Wed Oct 14 2020 Miroslav Lisik <mlisik@redhat.com> - 0.10.7-1
- Rebased to latest upstream sources (see CHANGELOG.md)
- Added python bundled dependency dateutil
- Fixed virtual bundle provides for ember, handelbars, jquery and jquery-ui
- Resolves: rhbz#1222691 rhbz#1741056 rhbz#1851335 rhbz#1862966 rhbz#1869399 rhbz#1873691 rhbz#1875301 rhbz#1883445 rhbz#1885658 rhbz#1885841
* Tue Aug 11 2020 Miroslav Lisik <mlisik@redhat.com> - 0.10.6-4
- Fixed invalid CIB error caused by resource and operation defaults with mixed and-or rules