diff --git a/.gitignore b/.gitignore index 60be2e2..6e8512c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,17 +1,17 @@ SOURCES/HAM-logo.png -SOURCES/backports-3.11.3.gem -SOURCES/ethon-0.11.0.gem -SOURCES/ffi-1.9.25.gem +SOURCES/backports-3.12.0.gem +SOURCES/ethon-0.12.0.gem +SOURCES/ffi-1.10.0.gem SOURCES/mock-1.0.1.tar.gz SOURCES/multi_json-1.13.1.gem SOURCES/open4-1.3.4.gem SOURCES/orderedhash-0.0.6.gem -SOURCES/pcs-0.9.165.tar.gz +SOURCES/pcs-0.9.167.tar.gz SOURCES/pyagentx-0.4.pcs.1.tar.gz -SOURCES/rack-1.6.10.gem +SOURCES/rack-1.6.11.gem SOURCES/rack-protection-1.5.5.gem -SOURCES/rack-test-0.7.0.gem +SOURCES/rack-test-0.8.3.gem SOURCES/rpam-ruby19-1.2.1.gem SOURCES/sinatra-1.4.8.gem SOURCES/sinatra-contrib-1.4.7.gem -SOURCES/tilt-2.0.8.gem +SOURCES/tilt-2.0.9.gem diff --git a/.pcs.metadata b/.pcs.metadata index 9e93a85..09d03b4 100644 --- a/.pcs.metadata +++ b/.pcs.metadata @@ -1,17 +1,17 @@ -80dc7788a3468fb7dd362a4b8bedd9efb373de89 SOURCES/HAM-logo.png -b8887abb18c0435eb8d4c9535e5619f7f6a458ec SOURCES/backports-3.11.3.gem -3c921ceeb2847be8cfa25704be74923e233786bd SOURCES/ethon-0.11.0.gem -86fa011857f977254ccf39f507587310f9ade768 SOURCES/ffi-1.9.25.gem +679a4ce22a33ffd4d704261a17c00cff98d9499a SOURCES/HAM-logo.png +727cdc5c9138091d39e8dca877bad78238a4d539 SOURCES/backports-3.12.0.gem +921ef1be44583a7644ee7f20fe5f26f21d018a04 SOURCES/ethon-0.12.0.gem +15d8209c5c420a141e38763b153b41e5de2535ba SOURCES/ffi-1.10.0.gem baa3446eb63557a24c4522dc5a61cfad082fa395 SOURCES/mock-1.0.1.tar.gz ff6e0965061cb6f604ee4d87a2cf96a2917f9f88 SOURCES/multi_json-1.13.1.gem 41a7fe9f8e3e02da5ae76c821b89c5b376a97746 SOURCES/open4-1.3.4.gem 709cc95025009e5d221e37cb0777e98582146809 SOURCES/orderedhash-0.0.6.gem -3fde33fc0fceb5b251391011b3f2e059d64e0386 SOURCES/pcs-0.9.165.tar.gz +99ab7aca9cb978c82da9727b4cfeae03c3cf1b28 SOURCES/pcs-0.9.167.tar.gz 276a92c6d679a71bd0daaf12cb7b3616f1a89b72 SOURCES/pyagentx-0.4.pcs.1.tar.gz -220afc472c53e0e0a0662c0dd6d4e74158f1845c SOURCES/rack-1.6.10.gem +64a0cd32f46c0ff44ffda4055048fe6309903110 SOURCES/rack-1.6.11.gem f80ea6672253a90fa031db0c1e2e1fe056582118 SOURCES/rack-protection-1.5.5.gem -3f41699c1c19ff2e2353583afa70799ced351a36 SOURCES/rack-test-0.7.0.gem +908e2a877da8eb6745073c51709dc024c4457e44 SOURCES/rack-test-0.8.3.gem a90e5a60d99445404a3c29a66d953a5e9918976d SOURCES/rpam-ruby19-1.2.1.gem 3377f6140321523d7751bed3b2cc8a5201d8ec9f SOURCES/sinatra-1.4.8.gem 83742328f21b684d6ce6c4747710c6e975b608e7 SOURCES/sinatra-contrib-1.4.7.gem -ac4b5bc216a961287b3c2ebde877c039d2f1a83d SOURCES/tilt-2.0.8.gem +55a75a80e29731d072fe44dfaf865479b65c27fd SOURCES/tilt-2.0.9.gem diff --git a/SOURCES/adapt-working-with-gems-to-rhel-7.patch b/SOURCES/adapt-working-with-gems-to-rhel-7.patch deleted file mode 100644 index a75940b..0000000 --- a/SOURCES/adapt-working-with-gems-to-rhel-7.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 8d958e9f63698bd05b19213ddbf71b57cb228135 Mon Sep 17 00:00:00 2001 -From: Ivan Devat -Date: Tue, 24 May 2016 07:26:15 +0200 -Subject: [PATCH 3/5] adapt working with gems to rhel 7 - ---- - pcsd/Gemfile | 1 - - pcsd/Gemfile.lock | 2 -- - pcsd/Makefile | 5 +---- - 3 files changed, 1 insertion(+), 7 deletions(-) - -diff --git a/pcsd/Gemfile b/pcsd/Gemfile -index 6418fd41..3598f533 100644 ---- a/pcsd/Gemfile -+++ b/pcsd/Gemfile -@@ -8,7 +8,6 @@ gem 'tilt' - gem 'rack-test' - gem 'backports' - gem 'rpam-ruby19' --gem 'json' - gem 'multi_json' - gem 'open4' - gem 'ffi' -diff --git a/pcsd/Gemfile.lock b/pcsd/Gemfile.lock -index 4b78bba6..137086ca 100644 ---- a/pcsd/Gemfile.lock -+++ b/pcsd/Gemfile.lock -@@ -4,7 +4,6 @@ GEM - backports (3.11.3) - ethon (0.11.0) - ffi (1.9.25) -- json (2.1.0) - multi_json (1.13.1) - open4 (1.3.4) - rack (1.6.10) -@@ -33,7 +32,6 @@ DEPENDENCIES - backports - ethon - ffi -- json - multi_json - open4 - rack -diff --git a/pcsd/Makefile b/pcsd/Makefile -index 21550c5a..642d0c83 100644 ---- a/pcsd/Makefile -+++ b/pcsd/Makefile -@@ -1,7 +1,7 @@ - FFI_VERSION="1.9.25" - FFI_C_DIR=vendor/bundle/ruby/gems/ffi-${FFI_VERSION}/ext/ffi_c - --build_gems: get_gems -+build_gems: - bundle install --local --deployment - #ffi makes symlink with absolute path. Let's change it to relative path. - for fname in `ls ${FFI_C_DIR}/libffi-*/include/ffitarget.h`; do \ -@@ -30,8 +30,5 @@ build_gems_without_bundler: - vendor/cache/tilt-2.0.8.gem \ - -- '--with-ldflags="-Wl,-z,now -Wl,-z,relro"' - --get_gems: -- bundle package -- - clean: - rm -rfv vendor/ --- -2.13.6 - diff --git a/SOURCES/bz1458153-01-give-back-orig.-master-behav.-resource-create.patch b/SOURCES/bz1458153-01-give-back-orig.-master-behav.-resource-create.patch index fb97ff0..b3b3965 100644 --- a/SOURCES/bz1458153-01-give-back-orig.-master-behav.-resource-create.patch +++ b/SOURCES/bz1458153-01-give-back-orig.-master-behav.-resource-create.patch @@ -1,16 +1,16 @@ -From 4d6997edab3c3e478fb0d73e0dc6dc2a924ed664 Mon Sep 17 00:00:00 2001 +From 0b642f384198d9df09c33ba1473909b7aeb4a572 Mon Sep 17 00:00:00 2001 From: Ivan Devat Date: Mon, 5 Jun 2017 17:13:41 +0200 -Subject: [PATCH 1/5] give back orig. --master behav. (resource create) +Subject: [PATCH] give back orig. --master behav. (resource create) --- pcs/cli/common/parse_args.py | 8 +- - pcs/cli/common/test/test_parse_args.py | 34 ++++++- - pcs/resource.py | 19 ++++ - pcs/test/cib_resource/test_create.py | 181 ++++++++++++++++++++++++++------- - pcs/test/test_constraints.py | 28 ++--- + pcs/cli/common/test/test_parse_args.py | 34 ++++- + pcs/resource.py | 19 +++ + pcs/test/cib_resource/test_create.py | 181 ++++++++++++++++++++----- + pcs/test/test_constraints.py | 28 ++-- pcs/test/test_resource.py | 10 +- - pcs/utils.py | 7 ++ + pcs/utils.py | 7 + 7 files changed, 228 insertions(+), 59 deletions(-) diff --git a/pcs/cli/common/parse_args.py b/pcs/cli/common/parse_args.py @@ -87,10 +87,10 @@ index efe38d0e..900094c9 100644 ], upgrade_args([ diff --git a/pcs/resource.py b/pcs/resource.py -index c605cc6a..cdba2bfd 100644 +index c6bb0aca..f615f682 100644 --- a/pcs/resource.py +++ b/pcs/resource.py -@@ -384,6 +384,25 @@ def resource_create(lib, argv, modifiers): +@@ -391,6 +391,25 @@ def resource_create(lib, argv, modifiers): ra_type = argv[1] parts = parse_create_args(argv[2:]) @@ -117,10 +117,10 @@ index c605cc6a..cdba2bfd 100644 defined_options = [opt for opt in parts_sections if opt in parts] if modifiers["group"]: diff --git a/pcs/test/cib_resource/test_create.py b/pcs/test/cib_resource/test_create.py -index 36202e34..e5f9dd4d 100644 +index ecb16384..57d95350 100644 --- a/pcs/test/cib_resource/test_create.py +++ b/pcs/test/cib_resource/test_create.py -@@ -233,7 +233,7 @@ class Success(ResourceTest): +@@ -238,7 +238,7 @@ class Success(ResourceTestLocal): def test_with_master(self): self.assert_effect( [ @@ -129,8 +129,8 @@ index 36202e34..e5f9dd4d 100644 "resource create R ocf:heartbeat:Dummy --no-default-ops master", ], """ -@@ -654,7 +654,7 @@ class SuccessGroup(ResourceTest): - class SuccessMaster(ResourceTest): +@@ -659,7 +659,7 @@ class SuccessGroup(ResourceTestLocal): + class SuccessMaster(ResourceTestLocal): def test_disable_is_on_master_element(self): self.assert_effect( - "resource create R ocf:heartbeat:Dummy --no-default-ops --disabled --master", @@ -138,7 +138,7 @@ index 36202e34..e5f9dd4d 100644 """ -@@ -675,13 +675,55 @@ class SuccessMaster(ResourceTest): +@@ -680,13 +680,55 @@ class SuccessMaster(ResourceTestLocal): """ ) @@ -197,7 +197,7 @@ index 36202e34..e5f9dd4d 100644 , """ -@@ -689,6 +731,9 @@ class SuccessMaster(ResourceTest): +@@ -694,6 +736,9 @@ class SuccessMaster(ResourceTestLocal): type="Dummy" > @@ -207,7 +207,7 @@ index 36202e34..e5f9dd4d 100644 -@@ -714,22 +759,58 @@ class SuccessMaster(ResourceTest): +@@ -719,22 +764,58 @@ class SuccessMaster(ResourceTestLocal): /> @@ -276,7 +276,7 @@ index 36202e34..e5f9dd4d 100644 " --no-default-ops" , """ -@@ -744,22 +825,53 @@ class SuccessMaster(ResourceTest): +@@ -749,22 +830,53 @@ class SuccessMaster(ResourceTestLocal): @@ -350,9 +350,9 @@ index 36202e34..e5f9dd4d 100644 - /> - - @@ -378,7 +378,7 @@ index 36202e34..e5f9dd4d 100644 , """ -@@ -1043,7 +1156,7 @@ class FailOrWarn(ResourceTest): +@@ -1048,7 +1161,7 @@ class FailOrWarn(ResourceTestLocal): def test_error_master_clone_combination(self): self.assert_pcs_fail( "resource create R ocf:heartbeat:Dummy --no-default-ops --clone" @@ -387,7 +387,7 @@ index 36202e34..e5f9dd4d 100644 , "Error: you can specify only one of clone, master, bundle or" " --group\n" -@@ -1051,7 +1164,7 @@ class FailOrWarn(ResourceTest): +@@ -1056,7 +1169,7 @@ class FailOrWarn(ResourceTestLocal): def test_error_master_group_combination(self): self.assert_pcs_fail( @@ -396,7 +396,7 @@ index 36202e34..e5f9dd4d 100644 " --group G" , "Error: you can specify only one of clone, master, bundle or" -@@ -1069,7 +1182,7 @@ class FailOrWarn(ResourceTest): +@@ -1074,7 +1187,7 @@ class FailOrWarn(ResourceTestLocal): def test_error_bundle_master_combination(self): self.assert_pcs_fail( @@ -406,10 +406,10 @@ index 36202e34..e5f9dd4d 100644 , "Error: you can specify only one of clone, master, bundle or" diff --git a/pcs/test/test_constraints.py b/pcs/test/test_constraints.py -index 07226acf..d17230ac 100644 +index d2278e08..142fb6f7 100644 --- a/pcs/test/test_constraints.py +++ b/pcs/test/test_constraints.py -@@ -346,43 +346,43 @@ Ticket Constraints: +@@ -349,43 +349,43 @@ Ticket Constraints: def testColocationConstraints(self): # see also BundleColocation @@ -463,7 +463,7 @@ index 07226acf..d17230ac 100644 output, returnVal = pcs(temp_cib, line) assert returnVal == 0 and output == "" -@@ -929,7 +929,7 @@ Ticket Constraints: +@@ -939,7 +939,7 @@ Ticket Constraints: assert returnVal == 1 def testLocationBadRules(self): @@ -472,7 +472,7 @@ index 07226acf..d17230ac 100644 ac(o,"") assert r == 0 -@@ -950,7 +950,7 @@ Ticket Constraints: +@@ -960,7 +960,7 @@ Ticket Constraints: """) assert r == 0 @@ -481,7 +481,7 @@ index 07226acf..d17230ac 100644 ac(o,"") assert r == 0 -@@ -989,7 +989,7 @@ Ticket Constraints: +@@ -999,7 +999,7 @@ Ticket Constraints: ac(o,"") assert r == 0 @@ -490,7 +490,7 @@ index 07226acf..d17230ac 100644 ac(o, """\ Warning: changing a monitor operation interval from 10 to 11 to make the operation unique """) -@@ -1110,7 +1110,7 @@ Ticket Constraints: +@@ -1120,7 +1120,7 @@ Ticket Constraints: self.assertEqual(0, returnVal) output, returnVal = pcs( @@ -500,10 +500,10 @@ index 07226acf..d17230ac 100644 ac(output, """\ Warning: changing a monitor operation interval from 10 to 11 to make the operation unique diff --git a/pcs/test/test_resource.py b/pcs/test/test_resource.py -index 59432999..7828efb4 100644 +index 3091517c..f514f9ed 100644 --- a/pcs/test/test_resource.py +++ b/pcs/test/test_resource.py -@@ -2840,7 +2840,7 @@ Ticket Constraints: +@@ -2738,7 +2738,7 @@ Ticket Constraints: output, returnVal = pcs( temp_cib, @@ -512,7 +512,7 @@ index 59432999..7828efb4 100644 ) assert returnVal == 0 assert output == "", [output] -@@ -2933,7 +2933,7 @@ Warning: changing a monitor operation interval from 10 to 11 to make the operati +@@ -2851,7 +2851,7 @@ Warning: changing a monitor operation interval from 10 to 11 to make the operati ac(o,"") assert r == 0 @@ -521,7 +521,7 @@ index 59432999..7828efb4 100644 ac(o,"") assert r == 0 -@@ -3147,7 +3147,7 @@ Warning: changing a monitor operation interval from 10 to 11 to make the operati +@@ -3077,7 +3077,7 @@ Warning: changing a monitor operation interval from 10 to 11 to make the operati output, returnVal = pcs( temp_cib, @@ -530,7 +530,7 @@ index 59432999..7828efb4 100644 ) ac(output, "") self.assertEqual(0, returnVal) -@@ -3741,7 +3741,7 @@ Error: Cannot remove more than one resource from cloned group +@@ -3742,7 +3742,7 @@ Error: Cannot remove more than one resource from cloned group # However those test the pcs library. I'm leaving these tests here to # test the cli part for now. self.assert_pcs_success( @@ -539,20 +539,20 @@ index 59432999..7828efb4 100644 "Warning: changing a monitor operation interval from 10 to 11 to make the operation unique\n" ) -@@ -4775,7 +4775,7 @@ class CloneMasterUpdate(unittest.TestCase, AssertPcsMixin): +@@ -5355,7 +5355,7 @@ class CloneMasterUpdate(unittest.TestCase, AssertPcsMixin): def test_no_op_allowed_in_master_update(self): self.assert_pcs_success( - "resource create dummy ocf:heartbeat:Dummy --master" + "resource create dummy ocf:heartbeat:Dummy master" ) - self.assert_pcs_success("resource show dummy-master", outdent( - """\ + self.assert_pcs_success( + "resource show dummy-master", diff --git a/pcs/utils.py b/pcs/utils.py -index 8a989f52..343a611b 100644 +index 8515aae9..c5e3c171 100644 --- a/pcs/utils.py +++ b/pcs/utils.py -@@ -2904,6 +2904,13 @@ def get_modifiers(): +@@ -2962,6 +2962,13 @@ def get_modifiers(): "wait": pcs_options.get("--wait", False), "watchdog": pcs_options.get("--watchdog", []), "no_watchdog_validation": "--no-watchdog-validation" in pcs_options, @@ -567,5 +567,5 @@ index 8a989f52..343a611b 100644 def exit_on_cmdline_input_errror(error, main_name, usage_name): -- -2.13.6 +2.17.0 diff --git a/SOURCES/bz1459503-01-OSP-workarounds-not-compatible-wi.patch b/SOURCES/bz1459503-01-OSP-workarounds-not-compatible-wi.patch index b3e4b3f..f822579 100644 --- a/SOURCES/bz1459503-01-OSP-workarounds-not-compatible-wi.patch +++ b/SOURCES/bz1459503-01-OSP-workarounds-not-compatible-wi.patch @@ -1,7 +1,7 @@ -From bbb137919a73cffdb635ed77d7f2b2e35f2cd056 Mon Sep 17 00:00:00 2001 +From 2eb9635de627abfaa14ee83ba4c022f7ecd9d74b Mon Sep 17 00:00:00 2001 From: Ivan Devat Date: Wed, 7 Jun 2017 14:36:05 +0200 -Subject: [PATCH 2/5] squash bz1459503 OSP workarounds not compatible wi +Subject: [PATCH] squash bz1459503 OSP workarounds not compatible wi reuse existing pcmk authkey during setup @@ -14,10 +14,10 @@ show only warn if `resource create` creates remote 4 files changed, 31 insertions(+), 22 deletions(-) diff --git a/pcs/cluster.py b/pcs/cluster.py -index e8c94ab8..c2af8a8f 100644 +index b1f63d45..42e94a94 100644 --- a/pcs/cluster.py +++ b/pcs/cluster.py -@@ -517,13 +517,21 @@ def cluster_setup(argv): +@@ -519,13 +519,21 @@ def cluster_setup(argv): print("Destroying cluster on nodes: {0}...".format( ", ".join(primary_addr_list) )) @@ -41,7 +41,7 @@ index e8c94ab8..c2af8a8f 100644 if modifiers["encryption"] == "1": file_definitions.update( diff --git a/pcs/lib/commands/resource.py b/pcs/lib/commands/resource.py -index 5637113c..6d59e8f9 100644 +index 90dab8f4..de5cfb4e 100644 --- a/pcs/lib/commands/resource.py +++ b/pcs/lib/commands/resource.py @@ -76,7 +76,8 @@ def _validate_remote_connection( @@ -65,10 +65,10 @@ index 5637113c..6d59e8f9 100644 ) diff --git a/pcs/test/cib_resource/test_create.py b/pcs/test/cib_resource/test_create.py -index e5f9dd4d..8a445f09 100644 +index 57d95350..3cd49e74 100644 --- a/pcs/test/cib_resource/test_create.py +++ b/pcs/test/cib_resource/test_create.py -@@ -1583,11 +1583,10 @@ class FailOrWarnGroup(ResourceTest): +@@ -1627,11 +1627,10 @@ class FailOrWarnGroup(ResourceTestLocal): ) def test_fail_when_on_pacemaker_remote_attempt(self): @@ -83,7 +83,7 @@ index e5f9dd4d..8a445f09 100644 ) def test_warn_when_on_pacemaker_remote_attempt(self): -@@ -1687,10 +1686,10 @@ class FailOrWarnGroup(ResourceTest): +@@ -1731,10 +1730,10 @@ class FailOrWarnGroup(ResourceTestLocal): ) def test_fail_when_on_pacemaker_remote_guest_attempt(self): @@ -98,10 +98,10 @@ index e5f9dd4d..8a445f09 100644 def test_warn_when_on_pacemaker_remote_guest_attempt(self): diff --git a/pcs/test/test_resource.py b/pcs/test/test_resource.py -index 7828efb4..8397df76 100644 +index f514f9ed..773b37cf 100644 --- a/pcs/test/test_resource.py +++ b/pcs/test/test_resource.py -@@ -5126,10 +5126,10 @@ class ResourceUpdateSpcialChecks(unittest.TestCase, AssertPcsMixin): +@@ -5712,10 +5712,10 @@ class ResourceUpdateRemoteAndGuestChecks(unittest.TestCase, AssertPcsMixin): self.assert_pcs_success( "resource create R ocf:heartbeat:Dummy", ) @@ -115,7 +115,7 @@ index 7828efb4..8397df76 100644 ) def test_update_warn_on_pacemaker_guest_attempt(self): self.assert_pcs_success( -@@ -5148,10 +5148,10 @@ class ResourceUpdateSpcialChecks(unittest.TestCase, AssertPcsMixin): +@@ -5734,10 +5734,10 @@ class ResourceUpdateRemoteAndGuestChecks(unittest.TestCase, AssertPcsMixin): "Warning: this command is not sufficient for creating a guest node," " use 'pcs cluster node add-guest'\n" ) @@ -129,7 +129,7 @@ index 7828efb4..8397df76 100644 ) def test_update_warn_on_pacemaker_guest_attempt_remove(self): -@@ -5172,10 +5172,10 @@ class ResourceUpdateSpcialChecks(unittest.TestCase, AssertPcsMixin): +@@ -5758,10 +5758,10 @@ class ResourceUpdateRemoteAndGuestChecks(unittest.TestCase, AssertPcsMixin): self.assert_pcs_success( "resource create R ocf:heartbeat:Dummy", ) @@ -143,7 +143,7 @@ index 7828efb4..8397df76 100644 ) def test_meta_warn_on_pacemaker_guest_attempt(self): -@@ -5196,10 +5196,10 @@ class ResourceUpdateSpcialChecks(unittest.TestCase, AssertPcsMixin): +@@ -5782,10 +5782,10 @@ class ResourceUpdateRemoteAndGuestChecks(unittest.TestCase, AssertPcsMixin): "Warning: this command is not sufficient for creating a guest node," " use 'pcs cluster node add-guest'\n" ) @@ -158,5 +158,5 @@ index 7828efb4..8397df76 100644 def test_meta_warn_on_pacemaker_guest_attempt_remove(self): -- -2.13.6 +2.17.0 diff --git a/SOURCES/bz1462248-01-fix-error-for-an-inaccessible-resource-in-a-bundle.patch b/SOURCES/bz1462248-01-fix-error-for-an-inaccessible-resource-in-a-bundle.patch deleted file mode 100644 index d90d09b..0000000 --- a/SOURCES/bz1462248-01-fix-error-for-an-inaccessible-resource-in-a-bundle.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 8811ee0493b956207f3336e9e0eb1395a530af8f Mon Sep 17 00:00:00 2001 -From: Ivan Devat -Date: Mon, 6 Aug 2018 08:43:47 +0200 -Subject: [PATCH] fix error for an inaccessible resource in a bundle - ---- - pcs/cli/common/console_report.py | 6 +++--- - pcs/cli/common/test/test_console_report.py | 6 +++--- - pcs/resource.py | 1 + - 3 files changed, 7 insertions(+), 6 deletions(-) - -diff --git a/pcs/cli/common/console_report.py b/pcs/cli/common/console_report.py -index f2cee05e..06ea8f72 100644 ---- a/pcs/cli/common/console_report.py -+++ b/pcs/cli/common/console_report.py -@@ -1434,8 +1434,8 @@ CODE_TO_MESSAGE_BUILDER_MAP = { - , - codes.RESOURCE_IN_BUNDLE_NOT_ACCESSIBLE: lambda info: - ( -- "Resource '{resource_id}' will not be accessible by the cluster " -- "inside bundle '{bundle_id}'. At least one of bundle options " -- "'control-port' or 'ip-range-start' has to be specified." -+ "Resource '{inner_resource_id}' will not be accessible by the " -+ "cluster inside bundle '{bundle_id}', at least one of bundle " -+ "options 'control-port' or 'ip-range-start' has to be specified" - ).format(**info) - } -diff --git a/pcs/cli/common/test/test_console_report.py b/pcs/cli/common/test/test_console_report.py -index dee633ad..5fe49466 100644 ---- a/pcs/cli/common/test/test_console_report.py -+++ b/pcs/cli/common/test/test_console_report.py -@@ -2126,12 +2126,12 @@ class ResourceInBundleNotAccessible(NameBuildTest): - self.assert_message_from_info( - ( - "Resource 'resourceA' will not be accessible by the cluster " -- "inside bundle 'bundleA'. At least one of bundle options " -- "'control-port' or 'ip-range-start' has to be specified." -+ "inside bundle 'bundleA', at least one of bundle options " -+ "'control-port' or 'ip-range-start' has to be specified" - ), - dict( - bundle_id="bundleA", -- resource_id="resourceA", -+ inner_resource_id="resourceA", - ) - ) - -diff --git a/pcs/resource.py b/pcs/resource.py -index 001bad50..c605cc6a 100644 ---- a/pcs/resource.py -+++ b/pcs/resource.py -@@ -439,6 +439,7 @@ def resource_create(lib, argv, modifiers): - **settings - ) - elif "bundle" in parts: -+ settings["allow_not_accessible_resource"] = modifiers["force"] - lib.resource.create_into_bundle( - ra_id, ra_type, parts["op"], - parts["meta"], --- -2.13.6 - diff --git a/SOURCES/bz1475318-01-rfe-validate-nodes-watchdog-device-by-using-sbd.patch b/SOURCES/bz1475318-01-rfe-validate-nodes-watchdog-device-by-using-sbd.patch deleted file mode 100644 index 0c73465..0000000 --- a/SOURCES/bz1475318-01-rfe-validate-nodes-watchdog-device-by-using-sbd.patch +++ /dev/null @@ -1,111 +0,0 @@ -From 2e5005b822b1dab3d074361f46607af3bd696b71 Mon Sep 17 00:00:00 2001 -From: Ivan Devat -Date: Mon, 6 Aug 2018 08:43:47 +0200 -Subject: [PATCH] squash bz1475318 RFE: Validate node's watchdog dev - -9d95b73a1b22 do not connect stdin of subprocess to pcs's stdin - -7607976d478e fix tests ---- - pcs/lib/external.py | 10 +++++++++- - pcs/test/test_lib_external.py | 8 ++++---- - pcs/utils.py | 8 +++++++- - 3 files changed, 20 insertions(+), 6 deletions(-) - -diff --git a/pcs/lib/external.py b/pcs/lib/external.py -index 5507543f..fe17a864 100644 ---- a/pcs/lib/external.py -+++ b/pcs/lib/external.py -@@ -25,6 +25,12 @@ try: - except ImportError: - # python3 - from urllib.parse import urlencode as urllib_urlencode -+try: -+ # python 3 -+ from subprocess import DEVNULL -+except ImportError: -+ # python 2 -+ DEVNULL = open(os.devnull, "r") - - from pcs import settings - from pcs.common import pcs_pycurl as pycurl -@@ -401,7 +407,9 @@ class CommandRunner(object): - process = subprocess.Popen( - args, - # Some commands react differently if they get anything via stdin -- stdin=(subprocess.PIPE if stdin_string is not None else None), -+ stdin=( -+ subprocess.PIPE if stdin_string is not None else DEVNULL -+ ), - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - preexec_fn=( -diff --git a/pcs/test/test_lib_external.py b/pcs/test/test_lib_external.py -index b249c47a..85c52a18 100644 ---- a/pcs/test/test_lib_external.py -+++ b/pcs/test/test_lib_external.py -@@ -74,7 +74,7 @@ class CommandRunnerTest(TestCase): - self.assert_popen_called_with( - mock_popen, - command, -- {"env": {}, "stdin": None,} -+ {"env": {}, "stdin": lib.DEVNULL,} - ) - logger_calls = [ - mock.call("Running: {0}\nEnvironment:".format(command_str)), -@@ -158,7 +158,7 @@ class CommandRunnerTest(TestCase): - self.assert_popen_called_with( - mock_popen, - command, -- {"env": {"a": "a", "b": "B", "c": "{C}"}, "stdin": None,} -+ {"env": {"a": "a", "b": "B", "c": "{C}"}, "stdin": lib.DEVNULL,} - ) - logger_calls = [ - mock.call( -@@ -327,7 +327,7 @@ class CommandRunnerTest(TestCase): - self.assert_popen_called_with( - mock_popen, - command, -- {"env": {}, "stdin": None,} -+ {"env": {}, "stdin": lib.DEVNULL,} - ) - logger_calls = [ - mock.call("Running: {0}\nEnvironment:".format(command_str)), -@@ -376,7 +376,7 @@ class CommandRunnerTest(TestCase): - self.assert_popen_called_with( - mock_popen, - command, -- {"env": {}, "stdin": None,} -+ {"env": {}, "stdin": lib.DEVNULL,} - ) - logger_calls = [ - mock.call("Running: {0}\nEnvironment:".format(command_str)), -diff --git a/pcs/utils.py b/pcs/utils.py -index eb02ca34..347ad73e 100644 ---- a/pcs/utils.py -+++ b/pcs/utils.py -@@ -86,6 +86,12 @@ try: - except ImportError: - # python3 - from urllib.parse import urlencode as urllib_urlencode -+try: -+ # python 3 -+ from subprocess import DEVNULL -+except ImportError: -+ # python 2 -+ DEVNULL = open(os.devnull, "r") - - - PYTHON2 = (sys.version_info.major == 2) -@@ -1035,7 +1041,7 @@ def run( - if string_for_stdin != None: - stdin_pipe = subprocess.PIPE - else: -- stdin_pipe = None -+ stdin_pipe = DEVNULL - - p = subprocess.Popen( - args, --- -2.13.6 - diff --git a/SOURCES/bz1475318-02-rfe-validate-nodes-watchdog-device-by-using-sbd.patch b/SOURCES/bz1475318-02-rfe-validate-nodes-watchdog-device-by-using-sbd.patch deleted file mode 100644 index 6aaf42d..0000000 --- a/SOURCES/bz1475318-02-rfe-validate-nodes-watchdog-device-by-using-sbd.patch +++ /dev/null @@ -1,86 +0,0 @@ -From e66477b89b6a0ffbb9220c1a384c2a283dddcf17 Mon Sep 17 00:00:00 2001 -From: Ondrej Mular -Date: Thu, 23 Aug 2018 14:49:05 +0200 -Subject: [PATCH] squash bz1475318 RFE: Validate node's watchdog dev - -6ae0b56ea1d9 fix watchdog device test error message - -3685516072c8 Mark all watchdogs listed by SBD as supported ---- - pcs/lib/sbd.py | 6 +++--- - pcs/stonith.py | 22 +++++----------------- - pcsd/remote.rb | 5 ++++- - 3 files changed, 12 insertions(+), 21 deletions(-) - -diff --git a/pcs/lib/sbd.py b/pcs/lib/sbd.py -index caf86a18..0e7f5b92 100644 ---- a/pcs/lib/sbd.py -+++ b/pcs/lib/sbd.py -@@ -302,10 +302,10 @@ def test_watchdog(cmd_runner, watchdog=None): - cmd = [settings.sbd_binary, "test-watchdog"] - if watchdog: - cmd.extend(["-w", watchdog]) -- dummy_std_out, std_err, ret_val = cmd_runner.run(cmd) -+ std_out, dummy_std_err, ret_val = cmd_runner.run(cmd) - if ret_val: -- if "Multiple watchdog devices discovered" in std_err: -+ if "Multiple watchdog devices discovered" in std_out: - raise LibraryError(reports.sbd_watchdog_test_multiple_devices()) -- raise LibraryError(reports.sbd_watchdog_test_error(std_err)) -+ raise LibraryError(reports.sbd_watchdog_test_error(std_out)) - else: - raise LibraryError(reports.sbd_watchdog_test_failed()) -diff --git a/pcs/stonith.py b/pcs/stonith.py -index cc805da8..707321ca 100644 ---- a/pcs/stonith.py -+++ b/pcs/stonith.py -@@ -503,25 +503,13 @@ def sbd_watchdog_list(lib, argv, modifiers): - raise CmdLineInputError() - - available_watchdogs = lib.sbd.get_local_available_watchdogs() -- supported_watchdog_list = [ -- wd for wd, wd_info in available_watchdogs.items() -- if wd_info["caution"] is None -- ] -- unsupported_watchdog_list = [ -- wd for wd in available_watchdogs -- if wd not in supported_watchdog_list -- ] -- -- if supported_watchdog_list: -- print("Supported watchdog(s):") -- for watchdog in supported_watchdog_list: -- print(" {}".format(watchdog)) - -- if unsupported_watchdog_list: -- print("Unsupported watchdog(s):") -- for watchdog in unsupported_watchdog_list: -+ if available_watchdogs: -+ print("Available watchdog(s):") -+ for watchdog in sorted(available_watchdogs.keys()): - print(" {}".format(watchdog)) -- -+ else: -+ print("No available watchdog") - - def sbd_watchdog_list_json(lib, argv, modifiers): - if argv: -diff --git a/pcsd/remote.rb b/pcsd/remote.rb -index 27af41b2..a74f28f5 100644 ---- a/pcsd/remote.rb -+++ b/pcsd/remote.rb -@@ -2408,7 +2408,10 @@ def check_sbd(param, request, auth_user) - :path => watchdog, - :exist => exists, - :is_supported => ( -- exists and available_watchdogs[watchdog]['caution'] == nil -+ # this method is not reliable so all watchdog devices listed by SBD -+ # will be listed as supported for now -+ # exists and available_watchdogs[watchdog]['caution'] == nil -+ exists - ), - } - rescue JSON::ParserError --- -2.13.6 - diff --git a/SOURCES/bz1488044-01-fix-pcs-cluster-cib-push-for-old-feature-set.patch b/SOURCES/bz1488044-01-fix-pcs-cluster-cib-push-for-old-feature-set.patch deleted file mode 100644 index f4ae99e..0000000 --- a/SOURCES/bz1488044-01-fix-pcs-cluster-cib-push-for-old-feature-set.patch +++ /dev/null @@ -1,229 +0,0 @@ -From e8d95b4ba03e62658ece669d6389b71b8553df1f Mon Sep 17 00:00:00 2001 -From: Ivan Devat -Date: Wed, 8 Aug 2018 13:48:24 +0200 -Subject: [PATCH] fix pcs cluster cib-push for old feature set - ---- - pcs/cluster.py | 56 +++++++++++++++++++++++++++++++++++++----- - pcs/lib/cib/test/test_tools.py | 29 ++++++++++++++++++++++ - pcs/lib/cib/tools.py | 6 ++--- - pcs/lib/env.py | 10 ++++++-- - 4 files changed, 90 insertions(+), 11 deletions(-) - -diff --git a/pcs/cluster.py b/pcs/cluster.py -index b4d49d27..e8c94ab8 100644 ---- a/pcs/cluster.py -+++ b/pcs/cluster.py -@@ -35,6 +35,7 @@ from pcs import ( - ) - from pcs.utils import parallel_for_nodes - from pcs.common import report_codes -+from pcs.common.tools import Version - from pcs.cli.common.errors import ( - CmdLineInputError, - ERR_NODE_LIST_AND_ALL_MUTUALLY_EXCLUSIVE, -@@ -46,6 +47,7 @@ from pcs.lib import ( - reports as lib_reports, - ) - from pcs.lib.booth import sync as booth_sync -+from pcs.lib.cib.tools import VERSION_FORMAT - from pcs.lib.commands.remote_node import _share_authkey, _destroy_pcmk_remote_env - from pcs.lib.commands.quorum import _add_device_model_net - from pcs.lib.communication.corosync import CheckCorosyncOffline -@@ -74,6 +76,7 @@ from pcs.lib.external import ( - NodeCommunicationException, - node_communicator_exception_to_report_item, - ) -+from pcs.lib.env import MIN_FEATURE_SET_VERSION_FOR_DIFF - from pcs.lib.env_tools import get_nodes - from pcs.lib.node import NodeAddresses - from pcs.lib import node_communication_format -@@ -1566,21 +1569,62 @@ def cluster_push(argv): - - if diff_against: - try: -- xml.dom.minidom.parse(diff_against) -+ original_cib = xml.dom.minidom.parse(diff_against) - except (EnvironmentError, xml.parsers.expat.ExpatError) as e: - utils.err("unable to parse original cib: %s" % e) -+ -+ def unable_to_diff(reason): -+ return error( -+ "unable to diff against original cib '{0}': {1}" -+ .format(diff_against, reason) -+ ) -+ -+ cib_element_list = original_cib.getElementsByTagName("cib") -+ -+ if len(cib_element_list) != 1: -+ raise unable_to_diff("there is not exactly one 'cib' element") -+ -+ crm_feature_set = cib_element_list[0].getAttribute("crm_feature_set") -+ if not crm_feature_set: -+ raise unable_to_diff( -+ "the 'cib' element is missing 'crm_feature_set' value" -+ ) -+ -+ match = re.match(VERSION_FORMAT, crm_feature_set) -+ if not match: -+ raise unable_to_diff( -+ "the attribute 'crm_feature_set' of the element 'cib' has an" -+ " invalid value: '{0}'".format(crm_feature_set) -+ ) -+ crm_feature_set_version = Version( -+ int(match.group("major")), -+ int(match.group("minor")), -+ int(match.group("rev")) if match.group("rev") else None -+ ) -+ -+ if crm_feature_set_version < MIN_FEATURE_SET_VERSION_FOR_DIFF: -+ raise unable_to_diff( -+ ( -+ "the 'crm_feature_set' version is '{0}'" -+ " but at least version '{1}' is required" -+ ).format( -+ crm_feature_set_version, -+ MIN_FEATURE_SET_VERSION_FOR_DIFF, -+ ) -+ ) -+ - runner = utils.cmd_runner() - command = [ - "crm_diff", "--original", diff_against, "--new", filename, - "--no-version" - ] -- patch, error, dummy_retval = runner.run(command) -+ patch, stderr, dummy_retval = runner.run(command) - # dummy_retval == 1 means one of two things: - # a) an error has occured - # b) --original and --new differ - # therefore it's of no use to see if an error occurred -- if error.strip(): -- utils.err("unable to diff the CIBs:\n" + error) -+ if stderr.strip(): -+ utils.err("unable to diff the CIBs:\n" + stderr) - if not patch.strip(): - print( - "The new CIB is the same as the original CIB, nothing to push." -@@ -1588,9 +1632,9 @@ def cluster_push(argv): - sys.exit(0) - - command = ["cibadmin", "--patch", "--xml-pipe"] -- output, error, retval = runner.run(command, patch) -+ output, stderr, retval = runner.run(command, patch) - if retval != 0: -- utils.err("unable to push cib\n" + error + output) -+ utils.err("unable to push cib\n" + stderr + output) - - else: - command = ["cibadmin", "--replace", "--xml-file", filename] -diff --git a/pcs/lib/cib/test/test_tools.py b/pcs/lib/cib/test/test_tools.py -index fab39ce7..2bdc7695 100644 ---- a/pcs/lib/cib/test/test_tools.py -+++ b/pcs/lib/cib/test/test_tools.py -@@ -436,6 +436,21 @@ class GetPacemakerVersionByWhichCibWasValidatedTest(TestCase): - ) - ) - -+ def test_invalid_version_at_end(self): -+ assert_raise_library_error( -+ lambda: lib.get_pacemaker_version_by_which_cib_was_validated( -+ etree.XML('') -+ ), -+ ( -+ severities.ERROR, -+ report_codes.CIB_LOAD_ERROR_BAD_FORMAT, -+ { -+ "reason": "the attribute 'validate-with' of the element" -+ " 'cib' has an invalid value: 'pacemaker-1.2.3x'" -+ } -+ ) -+ ) -+ - def test_no_revision(self): - self.assertEqual( - Version(1, 2), -@@ -507,6 +522,20 @@ class getCibCrmFeatureSet(TestCase): - ) - ) - -+ def test_invalid_version_at_end(self): -+ assert_raise_library_error( -+ lambda: lib.get_cib_crm_feature_set( -+ etree.XML('') -+ ), -+ fixture.error( -+ report_codes.CIB_LOAD_ERROR_BAD_FORMAT, -+ reason=( -+ "the attribute 'crm_feature_set' of the element 'cib' has " -+ "an invalid value: '3.0.9x'" -+ ) -+ ) -+ ) -+ - - find_group = partial(lib.find_element_by_tag_and_id, "group") - class FindTagWithId(TestCase): -diff --git a/pcs/lib/cib/tools.py b/pcs/lib/cib/tools.py -index 2cff96f3..ab2a9df5 100644 ---- a/pcs/lib/cib/tools.py -+++ b/pcs/lib/cib/tools.py -@@ -16,7 +16,7 @@ from pcs.lib.pacemaker.values import ( - ) - from pcs.lib.xml_tools import get_root, get_sub_element - --_VERSION_FORMAT = r"(?P\d+)\.(?P\d+)(\.(?P\d+))?" -+VERSION_FORMAT = r"(?P\d+)\.(?P\d+)(\.(?P\d+))?$" - - class IdProvider(object): - """ -@@ -289,7 +289,7 @@ def get_pacemaker_version_by_which_cib_was_validated(cib): - return _get_cib_version( - cib, - "validate-with", -- re.compile(r"pacemaker-{0}".format(_VERSION_FORMAT)) -+ re.compile(r"pacemaker-{0}".format(VERSION_FORMAT)) - ) - - def get_cib_crm_feature_set(cib, none_if_missing=False): -@@ -303,6 +303,6 @@ def get_cib_crm_feature_set(cib, none_if_missing=False): - return _get_cib_version( - cib, - "crm_feature_set", -- re.compile(_VERSION_FORMAT), -+ re.compile(r"^{0}".format(VERSION_FORMAT)), - none_if_missing=none_if_missing - ) -diff --git a/pcs/lib/env.py b/pcs/lib/env.py -index 86f67b64..3b2c06b6 100644 ---- a/pcs/lib/env.py -+++ b/pcs/lib/env.py -@@ -57,6 +57,8 @@ from pcs.lib.pacemaker.values import get_valid_timeout_seconds - from pcs.lib.tools import write_tmpfile - from pcs.lib.xml_tools import etree_to_str - -+MIN_FEATURE_SET_VERSION_FOR_DIFF = Version(3, 0, 9) -+ - class LibraryEnvironment(object): - # pylint: disable=too-many-instance-attributes - -@@ -211,10 +213,14 @@ class LibraryEnvironment(object): - # only check the version if a CIB has been loaded, otherwise the push - # fails anyway. By my testing it seems that only the source CIB's - # version matters. -- if self.__loaded_cib_diff_source_feature_set < Version(3, 0, 9): -+ if( -+ self.__loaded_cib_diff_source_feature_set -+ < -+ MIN_FEATURE_SET_VERSION_FOR_DIFF -+ ): - self.report_processor.process( - reports.cib_push_forced_full_due_to_crm_feature_set( -- Version(3, 0, 9), -+ MIN_FEATURE_SET_VERSION_FOR_DIFF, - self.__loaded_cib_diff_source_feature_set - ) - ) --- -2.13.6 - diff --git a/SOURCES/bz1572886-01-fix-syntax-multiple-except.-as-parenthes.-tuple.patch b/SOURCES/bz1572886-01-fix-syntax-multiple-except.-as-parenthes.-tuple.patch deleted file mode 100644 index 0d51b6c..0000000 --- a/SOURCES/bz1572886-01-fix-syntax-multiple-except.-as-parenthes.-tuple.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 19ad28a9be0344b8c0bcde7c711ecbf5062a95ea Mon Sep 17 00:00:00 2001 -From: Ivan Devat -Date: Mon, 6 Aug 2018 08:43:47 +0200 -Subject: [PATCH] fix syntax (multiple except. as parenthes. tuple) - -See https://docs.python.org/2/tutorial/errors.html#handling-exceptions - -...the parentheses around this tuple are required, because except -ValueError, e: was the syntax used for what is normally written as -except ValueError as e: in modern Python... ---- - pcs/cluster.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/pcs/cluster.py b/pcs/cluster.py -index a64fd5fd..b4d49d27 100644 ---- a/pcs/cluster.py -+++ b/pcs/cluster.py -@@ -1138,7 +1138,7 @@ class IsComponentStartSupported(object): - data["pcsd_capabilities"] - ): - self.supported = True -- except KeyError, ValueError: -+ except (KeyError, ValueError): - # not a valid json or 404 => not supported - pass - --- -2.13.6 - diff --git a/SOURCES/bz1599758-01-fix-node-communicator-getter.patch b/SOURCES/bz1599758-01-fix-node-communicator-getter.patch deleted file mode 100644 index e10c4b6..0000000 --- a/SOURCES/bz1599758-01-fix-node-communicator-getter.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 47400e6389452291ac44294181789665f90061d1 Mon Sep 17 00:00:00 2001 -From: Ivan Devat -Date: Mon, 6 Aug 2018 08:43:47 +0200 -Subject: [PATCH] fix node communicator getter - ---- - pcs/lib/env.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/pcs/lib/env.py b/pcs/lib/env.py -index 46eb9467..86f67b64 100644 ---- a/pcs/lib/env.py -+++ b/pcs/lib/env.py -@@ -417,7 +417,7 @@ class LibraryEnvironment(object): - return NodeCommunicator( - self.logger, - self.report_processor, -- self.__get_auth_tokens(), -+ self.__get_token_file()["tokens"], - self.user_login, - self.user_groups, - self._request_timeout --- -2.13.6 - diff --git a/SOURCES/bz1600169-01-disable-usage-of-Expect-HTTP-header.patch b/SOURCES/bz1600169-01-disable-usage-of-Expect-HTTP-header.patch deleted file mode 100644 index 23a0085..0000000 --- a/SOURCES/bz1600169-01-disable-usage-of-Expect-HTTP-header.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 5df7d647e3cdb4b73e0bfd0a4fa83b78efd861f5 Mon Sep 17 00:00:00 2001 -From: Ivan Devat -Date: Mon, 6 Aug 2018 08:43:47 +0200 -Subject: [PATCH] disable usage of 'Expect' HTTP header - ---- - pcs/common/node_communicator.py | 1 + - pcs/lib/external.py | 1 + - pcs/test/tools/custom_mock.py | 4 ++++ - pcs/utils.py | 1 + - pcsd/pcs.rb | 1 + - 5 files changed, 8 insertions(+) - -diff --git a/pcs/common/node_communicator.py b/pcs/common/node_communicator.py -index f7fe2419..d54e8566 100644 ---- a/pcs/common/node_communicator.py -+++ b/pcs/common/node_communicator.py -@@ -532,6 +532,7 @@ def _create_request_handle(request, cookies, timeout): - handle.setopt(pycurl.SSL_VERIFYHOST, 0) - handle.setopt(pycurl.SSL_VERIFYPEER, 0) - handle.setopt(pycurl.NOSIGNAL, 1) # required for multi-threading -+ handle.setopt(pycurl.HTTPHEADER, ["Expect: "]) - if cookies: - handle.setopt( - pycurl.COOKIE, _dict_to_cookies(cookies).encode("utf-8") -diff --git a/pcs/lib/external.py b/pcs/lib/external.py -index fe17a864..e53a54ee 100644 ---- a/pcs/lib/external.py -+++ b/pcs/lib/external.py -@@ -620,6 +620,7 @@ class NodeCommunicator(object): - handler.setopt(pycurl.SSL_VERIFYHOST, 0) - handler.setopt(pycurl.SSL_VERIFYPEER, 0) - handler.setopt(pycurl.NOSIGNAL, 1) # required for multi-threading -+ handler.setopt(pycurl.HTTPHEADER, ["Expect: "]) - if cookies: - handler.setopt(pycurl.COOKIE, ";".join(cookies).encode("utf-8")) - if data: -diff --git a/pcs/test/tools/custom_mock.py b/pcs/test/tools/custom_mock.py -index c05a5a45..849f83fb 100644 ---- a/pcs/test/tools/custom_mock.py -+++ b/pcs/test/tools/custom_mock.py -@@ -75,6 +75,10 @@ class MockCurl(object): - self._opts = {} - - def setopt(self, opt, val): -+ if isinstance(val, list): -+ # in tests we use set operations (e.g. assertLessEqual) which -+ # require hashable values -+ val = tuple(val) - if val is None: - self.unsetopt(opt) - else: -diff --git a/pcs/utils.py b/pcs/utils.py -index 347ad73e..8a989f52 100644 ---- a/pcs/utils.py -+++ b/pcs/utils.py -@@ -498,6 +498,7 @@ def sendHTTPRequest( - handler.setopt(pycurl.TIMEOUT_MS, int(timeout * 1000)) - handler.setopt(pycurl.SSL_VERIFYHOST, 0) - handler.setopt(pycurl.SSL_VERIFYPEER, 0) -+ handler.setopt(pycurl.HTTPHEADER, ["Expect: "]) - if cookies: - handler.setopt(pycurl.COOKIE, ";".join(cookies).encode("utf-8")) - if data: -diff --git a/pcsd/pcs.rb b/pcsd/pcs.rb -index 66919c0c..ad153f62 100644 ---- a/pcsd/pcs.rb -+++ b/pcsd/pcs.rb -@@ -513,6 +513,7 @@ def send_request( - :httpget => (post ? 0 : 1), - :nosignal => 1, # required for multi-threading - }) -+ req.compose_header('Expect', '') - return_code = req.perform - if return_code == :ok - return req.response_code, req.response_body --- -2.13.6 - diff --git a/SOURCES/bz1623181-01-fix-instance-attr-setting-for-OSP-agents.patch b/SOURCES/bz1623181-01-fix-instance-attr-setting-for-OSP-agents.patch deleted file mode 100644 index dfe488e..0000000 --- a/SOURCES/bz1623181-01-fix-instance-attr-setting-for-OSP-agents.patch +++ /dev/null @@ -1,207 +0,0 @@ -From b52c3ed9ec342b021357b915eaf6581f9f6a57d2 Mon Sep 17 00:00:00 2001 -From: Ondrej Mular -Date: Fri, 31 Aug 2018 10:12:18 +0200 -Subject: [PATCH] fix allowed instance attrs for some fence agents - -Fix is effective only for agents `fence_compute` and `fence_evacuate` ---- - pcs/lib/resource_agent.py | 22 ++++++++++++- - pcs/lib/test/test_resource_agent.py | 50 +++++++++++++++++++++++++++++ - pcs/test/test_stonith.py | 63 +++++++++++++++++++++++++++++++++++++ - 3 files changed, 134 insertions(+), 1 deletion(-) - -diff --git a/pcs/lib/resource_agent.py b/pcs/lib/resource_agent.py -index 34b18b9b..447cf1fe 100644 ---- a/pcs/lib/resource_agent.py -+++ b/pcs/lib/resource_agent.py -@@ -469,6 +469,14 @@ class Agent(object): - "obsoletes": parameter_element.get("obsoletes", None), - }) - -+ def _get_always_allowed_parameters(self): -+ """ -+ This method should be overriden in descendants. -+ -+ Returns set of always allowed parameters of a agent. -+ """ -+ return set() -+ - def validate_parameters( - self, parameters, - parameters_type="resource", -@@ -518,13 +526,17 @@ class Agent(object): - agent_params = self.get_parameters() - - required_missing = [] -+ always_allowed = self._get_always_allowed_parameters() - for attr in agent_params: - if attr["required"] and attr["name"] not in parameters_values: - required_missing.append(attr["name"]) - - valid_attrs = [attr["name"] for attr in agent_params] - return ( -- [attr for attr in parameters_values if attr not in valid_attrs], -+ [ -+ attr for attr in parameters_values -+ if attr not in valid_attrs and attr not in always_allowed -+ ], - required_missing - ) - -@@ -858,6 +870,14 @@ class StonithAgent(CrmAgent): - self._get_stonithd_metadata().get_parameters() - ) - -+ def _get_always_allowed_parameters(self): -+ if self.get_name() in ("fence_compute", "fence_evacuate"): -+ return set([ -+ "project-domain", "project_domain", "user-domain", -+ "user_domain", "compute-domain", "compute_domain", -+ ]) -+ return set() -+ - def validate_parameters( - self, parameters, - parameters_type="stonith", -diff --git a/pcs/lib/test/test_resource_agent.py b/pcs/lib/test/test_resource_agent.py -index 4ec94e26..2396bf30 100644 ---- a/pcs/lib/test/test_resource_agent.py -+++ b/pcs/lib/test/test_resource_agent.py -@@ -1275,6 +1275,23 @@ class AgentMetadataValidateParametersValuesTest(TestCase): - (["obsoletes"], ["deprecated"]) - ) - -+ @patch_agent_object( -+ "_get_always_allowed_parameters", -+ lambda self: set(["always_allowed", "another-one", "last_one"]) -+ ) -+ def test_always_allowed(self, mock_metadata): -+ mock_metadata.return_value = self.metadata -+ self.assertEqual( -+ self.agent.validate_parameters_values({ -+ "another_required_param": "value1", -+ "required_param": "value2", -+ "test_param": "value3", -+ "always_allowed": "value4", -+ "another-one": "value5", -+ }), -+ ([], []) -+ ) -+ - - class AgentMetadataValidateParameters(TestCase): - def setUp(self): -@@ -2175,3 +2192,36 @@ class AbsentResourceAgentTest(TestCase): - self.assertEqual(([], []), absent.validate_parameters_values({ - "whatever": "anything" - })) -+ -+ -+class StonithAgentAlwaysAllowedParametersTest(TestCase): -+ def setUp(self): -+ self.runner = mock.MagicMock(spec_set=CommandRunner) -+ self.always_allowed = set([ -+ "project-domain", "project_domain", "user-domain", "user_domain", -+ "compute-domain", "compute_domain", -+ ]) -+ -+ def test_fence_compute(self): -+ self.assertEquals( -+ self.always_allowed, -+ lib_ra.StonithAgent( -+ self.runner, "fence_compute" -+ )._get_always_allowed_parameters() -+ ) -+ -+ def test_fence_evacuate(self): -+ self.assertEquals( -+ self.always_allowed, -+ lib_ra.StonithAgent( -+ self.runner, "fence_evacuate" -+ )._get_always_allowed_parameters() -+ ) -+ -+ def test_some_other_agent(self): -+ self.assertEquals( -+ set(), -+ lib_ra.StonithAgent( -+ self.runner, "fence_dummy" -+ )._get_always_allowed_parameters() -+ ) -diff --git a/pcs/test/test_stonith.py b/pcs/test/test_stonith.py -index cdb2ecee..ff981acc 100644 ---- a/pcs/test/test_stonith.py -+++ b/pcs/test/test_stonith.py -@@ -469,6 +469,69 @@ class StonithTest(TestCase, AssertPcsMixin): - ) - ) - -+ def test_stonith_compute_evacuate_always_allowed_parameters(self): -+ self.assert_pcs_success( -+ "stonith create test1 fence_compute auth_url=test1 project_domain=val1 project-domain=val2 user_domain=val3 user-domain=val4 compute_domain=val5 compute-domain=val6", -+ ) -+ self.assert_pcs_success( -+ "stonith show --full", -+ outdent( -+ """\ -+ Resource: test1 (class=stonith type=fence_compute) -+ Attributes: auth_url=test1 compute-domain=val6 compute_domain=val5 project-domain=val2 project_domain=val1 user-domain=val4 user_domain=val3 -+ Operations: monitor interval=60s (test1-monitor-interval-60s) -+ """ -+ ) -+ ) -+ self.assert_pcs_success( -+ "stonith create test2 fence_evacuate auth_url=test2 project_domain=val0 project-domain=val1 user_domain=val2 user-domain=val3 compute_domain=val4 compute-domain=val5", -+ ) -+ self.assert_pcs_success( -+ "stonith show --full", -+ outdent( -+ """\ -+ Resource: test1 (class=stonith type=fence_compute) -+ Attributes: auth_url=test1 compute-domain=val6 compute_domain=val5 project-domain=val2 project_domain=val1 user-domain=val4 user_domain=val3 -+ Operations: monitor interval=60s (test1-monitor-interval-60s) -+ Resource: test2 (class=stonith type=fence_evacuate) -+ Attributes: auth_url=test2 compute-domain=val5 compute_domain=val4 project-domain=val1 project_domain=val0 user-domain=val3 user_domain=val2 -+ Operations: monitor interval=60s (test2-monitor-interval-60s) -+ """ -+ ) -+ ) -+ self.assert_pcs_success( -+ "stonith update test1 auth_url=new0 project_domain=new1 project-domain=new2 user_domain=new3 user-domain=new4 compute_domain=new5 compute-domain=new6", -+ ) -+ self.assert_pcs_success( -+ "stonith show --full", -+ outdent( -+ """\ -+ Resource: test1 (class=stonith type=fence_compute) -+ Attributes: auth_url=new0 compute-domain=new6 compute_domain=new5 project-domain=new2 project_domain=new1 user-domain=new4 user_domain=new3 -+ Operations: monitor interval=60s (test1-monitor-interval-60s) -+ Resource: test2 (class=stonith type=fence_evacuate) -+ Attributes: auth_url=test2 compute-domain=val5 compute_domain=val4 project-domain=val1 project_domain=val0 user-domain=val3 user_domain=val2 -+ Operations: monitor interval=60s (test2-monitor-interval-60s) -+ """ -+ ) -+ ) -+ self.assert_pcs_success( -+ "stonith update test2 auth_url=new1 project_domain=new2 project-domain=new3 user_domain=new4 user-domain=new5 compute_domain=new6 compute-domain=new7", -+ ) -+ self.assert_pcs_success( -+ "stonith show --full", -+ outdent( -+ """\ -+ Resource: test1 (class=stonith type=fence_compute) -+ Attributes: auth_url=new0 compute-domain=new6 compute_domain=new5 project-domain=new2 project_domain=new1 user-domain=new4 user_domain=new3 -+ Operations: monitor interval=60s (test1-monitor-interval-60s) -+ Resource: test2 (class=stonith type=fence_evacuate) -+ Attributes: auth_url=new1 compute-domain=new7 compute_domain=new6 project-domain=new3 project_domain=new2 user-domain=new5 user_domain=new4 -+ Operations: monitor interval=60s (test2-monitor-interval-60s) -+ """ -+ ) -+ ) -+ - def testStonithFenceConfirm(self): - output, returnVal = pcs(temp_cib, "stonith fence blah blah") - assert returnVal == 1 --- -2.13.6 - diff --git a/SOURCES/cache-tokens-read-from-pcsd.patch b/SOURCES/cache-tokens-read-from-pcsd.patch deleted file mode 100644 index 3290bca..0000000 --- a/SOURCES/cache-tokens-read-from-pcsd.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 7bfa0658bd7e6ffa526ed965fb4a9680414320e5 Mon Sep 17 00:00:00 2001 -From: Tomas Jelinek -Date: Tue, 19 Feb 2019 15:40:05 +0100 -Subject: [PATCH 1/3] cache tokens read from pcsd - ---- - pcs/cluster.py | 4 ++++ - pcs/status.py | 1 + - pcs/utils.py | 1 + - 3 files changed, 6 insertions(+) - -diff --git a/pcs/cluster.py b/pcs/cluster.py -index 7d13e11e..8cb27c82 100644 ---- a/pcs/cluster.py -+++ b/pcs/cluster.py -@@ -1167,6 +1167,7 @@ def start_cluster_nodes(nodes): - ) - was_error = False - -+ utils.read_token_file() # cache node tokens - task_list = [ - IsComponentStartSupported(node) for node in nodes - ] -@@ -1278,6 +1279,7 @@ def wait_for_nodes_started(node_list, timeout=None): - else: - print(output) - else: -+ utils.read_token_file() # cache node tokens - node_errors = parallel_for_nodes( - wait_for_remote_node_started, node_list, stop_at, interval - ) -@@ -1296,6 +1298,7 @@ def stop_cluster_nodes(nodes): - % "', '".join(unknown_nodes) - ) - -+ utils.read_token_file() # cache node tokens - stopping_all = set(nodes) >= set(all_nodes) - if "--force" not in utils.pcs_options and not stopping_all: - error_list = [] -@@ -1406,6 +1409,7 @@ def destroy_cluster(argv, keep_going=False): - if len(argv) > 0: - # stop pacemaker and resources while cluster is still quorate - nodes = argv -+ utils.read_token_file() # cache node tokens - node_errors = parallel_for_nodes( - utils.repeat_if_timeout(utils.stopPacemaker), - nodes, -diff --git a/pcs/status.py b/pcs/status.py -index 69cea716..647faed8 100644 ---- a/pcs/status.py -+++ b/pcs/status.py -@@ -401,6 +401,7 @@ def check_nodes(node_list, prefix=""): - )) - status_list.append(returncode) - -+ utils.read_token_file() # cache node tokens - utils.run_parallel( - utils.create_task_list(report, utils.checkAuthorization, node_list) - ) -diff --git a/pcs/utils.py b/pcs/utils.py -index 343a611b..839e931f 100644 ---- a/pcs/utils.py -+++ b/pcs/utils.py -@@ -245,6 +245,7 @@ def remove_uid_gid_file(uid,gid): - def readTokens(): - return read_token_file()["tokens"] - -+@simple_cache - def read_token_file(): - data = { - "tokens": {}, --- -2.17.0 - diff --git a/SOURCES/change-cman-to-rhel6-in-messages.patch b/SOURCES/change-cman-to-rhel6-in-messages.patch index 928ca1b..3d6024c 100644 --- a/SOURCES/change-cman-to-rhel6-in-messages.patch +++ b/SOURCES/change-cman-to-rhel6-in-messages.patch @@ -1,7 +1,7 @@ -From 584e0e4d16e7e811aaac24f0db11bf59c909b895 Mon Sep 17 00:00:00 2001 +From 2f1dd5e33e00cd36f47ca91ed21a3071f0ef0c6e Mon Sep 17 00:00:00 2001 From: Ivan Devat Date: Mon, 23 May 2016 17:00:13 +0200 -Subject: [PATCH 4/5] change cman to rhel6 in messages +Subject: [PATCH] change cman to rhel6 in messages --- pcs/cli/common/console_report.py | 8 ++++---- @@ -17,10 +17,10 @@ Subject: [PATCH 4/5] change cman to rhel6 in messages 10 files changed, 48 insertions(+), 48 deletions(-) diff --git a/pcs/cli/common/console_report.py b/pcs/cli/common/console_report.py -index 06ea8f72..973b2cbb 100644 +index 4e0ae436..945b83f6 100644 --- a/pcs/cli/common/console_report.py +++ b/pcs/cli/common/console_report.py -@@ -676,7 +676,7 @@ CODE_TO_MESSAGE_BUILDER_MAP = { +@@ -698,7 +698,7 @@ CODE_TO_MESSAGE_BUILDER_MAP = { , codes.CMAN_UNSUPPORTED_COMMAND: @@ -29,7 +29,7 @@ index 06ea8f72..973b2cbb 100644 , codes.ID_ALREADY_EXISTS: lambda info: -@@ -932,7 +932,7 @@ CODE_TO_MESSAGE_BUILDER_MAP = { +@@ -958,7 +958,7 @@ CODE_TO_MESSAGE_BUILDER_MAP = { , codes.IGNORED_CMAN_UNSUPPORTED_OPTION: lambda info: @@ -38,7 +38,7 @@ index 06ea8f72..973b2cbb 100644 .format(**info) , -@@ -941,12 +941,12 @@ CODE_TO_MESSAGE_BUILDER_MAP = { +@@ -967,12 +967,12 @@ CODE_TO_MESSAGE_BUILDER_MAP = { , codes.CMAN_UDPU_RESTART_REQUIRED: ( @@ -54,10 +54,10 @@ index 06ea8f72..973b2cbb 100644 ), diff --git a/pcs/cluster.py b/pcs/cluster.py -index c2af8a8f..7d13e11e 100644 +index 42e94a94..d54d8fb9 100644 --- a/pcs/cluster.py +++ b/pcs/cluster.py -@@ -2105,7 +2105,7 @@ def node_add(lib_env, node0, node1, modifiers): +@@ -2111,7 +2111,7 @@ def node_add(lib_env, node0, node1, modifiers): else: utils.err("Unable to update any nodes") if utils.is_cman_with_udpu_transport(): @@ -66,7 +66,7 @@ index c2af8a8f..7d13e11e 100644 + "cluster restart is required to apply node addition") if wait: print() -@@ -2181,7 +2181,7 @@ def node_remove(lib_env, node0, modifiers): +@@ -2187,7 +2187,7 @@ def node_remove(lib_env, node0, modifiers): output, retval = utils.reloadCorosync() output, retval = utils.run(["crm_node", "--force", "-R", node0]) if utils.is_cman_with_udpu_transport(): @@ -75,7 +75,7 @@ index c2af8a8f..7d13e11e 100644 + "cluster restart is required to apply node removal") def cluster_localnode(argv): -@@ -2349,7 +2349,7 @@ def cluster_uidgid(argv, silent_list = False): +@@ -2355,7 +2355,7 @@ def cluster_uidgid(argv, silent_list = False): def cluster_get_corosync_conf(argv): if utils.is_rhel6(): @@ -85,10 +85,10 @@ index c2af8a8f..7d13e11e 100644 if len(argv) > 1: usage.cluster() diff --git a/pcs/config.py b/pcs/config.py -index 11ddb901..747d1b24 100644 +index 0afcd85d..8f31e79a 100644 --- a/pcs/config.py +++ b/pcs/config.py -@@ -613,7 +613,7 @@ def config_checkpoint_restore(argv): +@@ -740,7 +740,7 @@ def config_checkpoint_restore(argv): def config_import_cman(argv): if no_clufter: @@ -98,10 +98,10 @@ index 11ddb901..747d1b24 100644 cluster_conf = settings.cluster_conf_file dry_run_output = None diff --git a/pcs/pcs.8 b/pcs/pcs.8 -index 8b1ed840..3bf6d553 100644 +index 6440bb70..0ec4359a 100644 --- a/pcs/pcs.8 +++ b/pcs/pcs.8 -@@ -209,13 +209,13 @@ auth [[:]] [...] [\fB\-u\fR ] [\fB\-p\fR ] [\fB\ +@@ -215,13 +215,13 @@ auth [[:]] [...] [\fB\-u\fR ] [\fB\-p\fR ] [\fB\ Authenticate pcs to pcsd on nodes specified, or on all nodes configured in the local cluster if no nodes are specified (authorization tokens are stored in ~/.pcs/tokens or /var/lib/pcsd/tokens for root). By default all nodes are also authenticated to each other, using \fB\-\-local\fR only authenticates the local node (and does not authenticate the remote nodes with each other). Using \fB\-\-force\fR forces re\-authentication to occur. .TP setup [\fB\-\-start\fR [\fB\-\-wait\fR[=]]] [\fB\-\-local\fR] [\fB\-\-enable\fR] \fB\-\-name\fR [] [...] [\fB\-\-transport\fR udpu|udp] [\fB\-\-rrpmode\fR active|passive] [\fB\-\-addr0\fR [[[\fB\-\-mcast0\fR
] [\fB\-\-mcastport0\fR ] [\fB\-\-ttl0\fR ]] | [\fB\-\-broadcast0\fR]] [\fB\-\-addr1\fR [[[\fB\-\-mcast1\fR
] [\fB\-\-mcastport1\fR ] [\fB\-\-ttl1\fR ]] | [\fB\-\-broadcast1\fR]]]] [\fB\-\-wait_for_all\fR=<0|1>] [\fB\-\-auto_tie_breaker\fR=<0|1>] [\fB\-\-last_man_standing\fR=<0|1> [\fB\-\-last_man_standing_window\fR=