diff --git a/.pcs.metadata b/.pcs.metadata index e39b7ea..68b2d71 100644 --- a/.pcs.metadata +++ b/.pcs.metadata @@ -1,3 +1,4 @@ +80dc7788a3468fb7dd362a4b8bedd9efb373de89 SOURCES/HAM-logo.png 5c9dd0d5552d242ee6bb338a9097e85f0a0a45d5 SOURCES/backports-3.6.8.gem 60b6f1d8391cd374c6a2ef3977cb1397ed89055a SOURCES/eventmachine-1.2.0.1.gem baa3446eb63557a24c4522dc5a61cfad082fa395 SOURCES/mock-1.0.1.tar.gz @@ -12,5 +13,3 @@ a90e5a60d99445404a3c29a66d953a5e9918976d SOURCES/rpam-ruby19-1.2.1.gem 1c7f1ad8af670f4990373ebddb4d9fecd8f3c7d1 SOURCES/sinatra-1.4.7.gem 83742328f21b684d6ce6c4747710c6e975b608e7 SOURCES/sinatra-contrib-1.4.7.gem 49bee6e8614c1e991c1156150b0a2eaa28868f8d SOURCES/tilt-2.0.3.gem -9c06bb646aba6330d4d85fe08415cdd2276fe918 SOURCES/HAM-logo.png -062c9973625dced9a54a2f83a7baf7696ac37d60 SOURCES/favicon.ico diff --git a/SOURCES/bz1404233-01-cluster-cib-push-allows-to-obtain-and-push-a-diff.patch b/SOURCES/bz1404233-01-cluster-cib-push-allows-to-obtain-and-push-a-diff.patch index 724c0bb..b9649dc 100644 --- a/SOURCES/bz1404233-01-cluster-cib-push-allows-to-obtain-and-push-a-diff.patch +++ b/SOURCES/bz1404233-01-cluster-cib-push-allows-to-obtain-and-push-a-diff.patch @@ -1,4 +1,4 @@ -From 24f48d185b03b3bcff28d78a3be657f2a1295e4b Mon Sep 17 00:00:00 2001 +From 5cd73a40d15e1ef692130e0a85e2f2e411bd8b66 Mon Sep 17 00:00:00 2001 From: Tomas Jelinek Date: Fri, 6 Jan 2017 15:26:11 +0100 Subject: [PATCH] 'cluster cib-push' allows to obtain and push a diff @@ -86,7 +86,7 @@ index 4572643..69e2852 100644 return cmd = ["crm_resource", "--wait"] diff --git a/pcs/pcs.8 b/pcs/pcs.8 -index dffaddd..bf4b859 100644 +index dffaddd..4062ce3 100644 --- a/pcs/pcs.8 +++ b/pcs/pcs.8 @@ -262,8 +262,14 @@ Sync corosync configuration to all nodes found from current corosync.conf file ( @@ -95,7 +95,7 @@ index dffaddd..bf4b859 100644 .TP -cib-push [scope= | \fB\-\-config\fR] [\fB\-\-wait\fR[=]] -Push the raw xml from to the CIB (Cluster Information Base). You can obtain the CIB by running the 'pcs cluster cib' command, which is recommended first step when you want to perform desired modifications (pcs \fB\-f\fR ) for the one-off push. Specify scope to push a specific section of the CIB. Valid values of the scope are: configuration, nodes, resources, constraints, crm_config, rsc_defaults, op_defaults. \fB\-\-config\fR is the same as scope=configuration. Use of \fB\-\-config\fR is recommended. Do not specify a scope if you need to push the whole CIB or be warned in the case of outdated CIB. If --wait is specified wait up to 'n' seconds for changes to be applied. WARNING: the selected scope of the CIB will be overwritten by the current content of the specified file. -+cib-push [diff\-against= scope= | \fB\-\-config\fR] [\fB\-\-wait\fR[=]] ++cib-push [diff\-against= | scope= | \fB\-\-config\fR] [\fB\-\-wait\fR[=]] +Push the raw xml from to the CIB (Cluster Information Base). You can obtain the CIB by running the 'pcs cluster cib' command, which is recommended first step when you want to perform desired modifications (pcs \fB\-f\fR ) for the one\-off push. If diff\-against is specified, pcs diffs contents of filename against contents of filename_original and pushes the result to the CIB. Specify scope to push a specific section of the CIB. Valid values of the scope are: configuration, nodes, resources, constraints, crm_config, rsc_defaults, op_defaults. \fB\-\-config\fR is the same as scope=configuration. Use of \fB\-\-config\fR is recommended. Do not specify a scope if you need to push the whole CIB or be warned in the case of outdated CIB. If --wait is specified wait up to 'n' seconds for changes to be applied. WARNING: the selected scope of the CIB will be overwritten by the current content of the specified file. + +Example: diff --git a/SOURCES/bz1420757-01-fix-pcs-cluster-cib-push-scope.patch b/SOURCES/bz1420757-01-fix-pcs-cluster-cib-push-scope.patch new file mode 100644 index 0000000..64a7edc --- /dev/null +++ b/SOURCES/bz1420757-01-fix-pcs-cluster-cib-push-scope.patch @@ -0,0 +1,46 @@ +From 0d63dd38a152f6edc852b209ee82e00f31cc7a70 Mon Sep 17 00:00:00 2001 +From: Tomas Jelinek +Date: Tue, 7 Feb 2017 17:50:51 +0100 +Subject: [PATCH] fix "pcs cluster cib-push scope=" + +--- + pcs/cluster.py | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/pcs/cluster.py b/pcs/cluster.py +index 69e2852..32ea8c3 100644 +--- a/pcs/cluster.py ++++ b/pcs/cluster.py +@@ -1201,23 +1201,25 @@ def cluster_push(argv): + filename = arg + else: + arg_name, arg_value = arg.split("=", 1) +- if arg_name == "scope" and "--config" not in utils.pcs_options: ++ if arg_name == "scope": ++ if "--config" in utils.pcs_options: ++ utils.err("Cannot use both scope and --config") + if not utils.is_valid_cib_scope(arg_value): + utils.err("invalid CIB scope '%s'" % arg_value) + else: + scope = arg_value +- if arg_name == "diff-against": ++ elif arg_name == "diff-against": + diff_against = arg_value + else: + usage.cluster(["cib-push"]) + sys.exit(1) + if "--config" in utils.pcs_options: + scope = "configuration" ++ if diff_against and scope: ++ utils.err("Cannot use both scope and diff-against") + if not filename: + usage.cluster(["cib-push"]) + sys.exit(1) +- if diff_against and scope: +- utils.err("Cannot use both scope and diff-against") + + try: + new_cib_dom = xml.dom.minidom.parse(filename) +-- +1.8.3.1 + diff --git a/SOURCES/bz1420757-02-fix-cib-push-diff-against-when-the-diff-is-empty.patch b/SOURCES/bz1420757-02-fix-cib-push-diff-against-when-the-diff-is-empty.patch new file mode 100644 index 0000000..91f4eb8 --- /dev/null +++ b/SOURCES/bz1420757-02-fix-cib-push-diff-against-when-the-diff-is-empty.patch @@ -0,0 +1,30 @@ +From 0fb8059bc401c5797ec7c1c46a8aed5ad6b63249 Mon Sep 17 00:00:00 2001 +From: Tomas Jelinek +Date: Tue, 14 Feb 2017 09:19:15 +0100 +Subject: [PATCH 3/3] fix 'cib-push diff-against=' when the diff is empty + +--- + pcs/cluster.py | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/pcs/cluster.py b/pcs/cluster.py +index 32ea8c3..1af1ebf 100644 +--- a/pcs/cluster.py ++++ b/pcs/cluster.py +@@ -1245,8 +1245,13 @@ def cluster_push(argv): + # 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 not patch.strip(): ++ utils.err( ++ "The new CIB is the same as the original CIB, nothing to push." ++ ) + + command = ["cibadmin", "--patch", "--xml-pipe"] + output, error, retval = runner.run(command, patch) +-- +1.8.3.1 + diff --git a/SPECS/pcs.spec b/SPECS/pcs.spec index db37b66..bf35fc0 100644 --- a/SPECS/pcs.spec +++ b/SPECS/pcs.spec @@ -1,6 +1,6 @@ Name: pcs Version: 0.9.152 -Release: 10%{?dist}.1 +Release: 10%{?dist}.3 License: GPLv2 URL: https://github.com/ClusterLabs/pcs Group: System Environment/Base @@ -25,7 +25,6 @@ Source12: https://rubygems.org/downloads/sinatra-contrib-1.4.7.gem Source13: https://rubygems.org/downloads/sinatra-1.4.7.gem Source14: https://rubygems.org/downloads/tilt-2.0.3.gem Source15: https://github.com/testing-cabal/mock/archive/1.0.1.tar.gz#/mock-1.0.1.tar.gz -Source99: favicon.ico Patch0: bz1315371-01-add-support-for-pacemaker-alerts.patch Patch1: bz1158805-01-add-support-for-qdevice-qnetd-provided-.patch @@ -87,6 +86,8 @@ Patch55: change-cman-to-rhel6-in-messages.patch Patch56: show-only-warning-when-crm_mon-xml-is-invalid.patch Patch57: bz1408476-01-accept-RA-with-instantiated-systemd-service-in-name.patch Patch58: bz1404233-01-cluster-cib-push-allows-to-obtain-and-push-a-diff.patch +Patch59: bz1420757-01-fix-pcs-cluster-cib-push-scope.patch +Patch60: bz1420757-02-fix-cib-push-diff-against-when-the-diff-is-empty.patch BuildRequires: python2-devel python-setuptools BuildRequires: gcc gcc-c++ @@ -207,9 +208,10 @@ UpdateTimestamps -p1 %{PATCH55} UpdateTimestamps -p1 %{PATCH56} UpdateTimestamps -p1 %{PATCH57} UpdateTimestamps -p1 %{PATCH58} +UpdateTimestamps -p1 %{PATCH59} +UpdateTimestamps -p1 %{PATCH60} cp -f %SOURCE1 pcsd/public/images -cp -f %SOURCE99 pcsd/public mkdir -p pcsd/.bundle cp -f %SOURCE2 pcsd/.bundle/config @@ -354,8 +356,13 @@ run_all_tests %doc COPYING README %changelog -* Wed Feb 1 2017 Johnny Hughes - 0.9.152-10.el7.centos.1 -- Roll in CentOS Branding (centos bug #9426) +* Tue Feb 14 2017 Ivan Devat - 0.9.152-10.el7_3.3 +- Provide a better error message in `pcs cluster cib-push` when the diff of the old and the new CIB is empty +- Resolves: rhbz#1420757 + +* Fri Feb 10 2017 Ivan Devat - 0.9.152-10.el7_3.2 +- Fixed recognition of the parameter 'scope' in 'cluster cib push' +- Resolves: rhbz#1420757 * Mon Jan 16 2017 Ivan Devat - 0.9.152-10.el7_3.1 - Fixed resolving resource agent name containing systemd service instance