From 8b53ec6cc3cd4a80642c14249e0c187ee7144ddf Mon Sep 17 00:00:00 2001 From: MSVSphere Packaging Team Date: Fri, 4 Aug 2023 20:21:20 +0300 Subject: [PATCH] import resource-agents-4.10.0-34.el9_2.2 --- ...e-events-1-fix-no-transition-summary.patch | 54 +++++++++++++ ...2182764-azure-events-2-improve-logic.patch | 77 +++++++++++++++++++ SPECS/resource-agents.spec | 18 ++++- 3 files changed, 147 insertions(+), 2 deletions(-) create mode 100644 SOURCES/bz2182764-azure-events-1-fix-no-transition-summary.patch create mode 100644 SOURCES/bz2182764-azure-events-2-improve-logic.patch diff --git a/SOURCES/bz2182764-azure-events-1-fix-no-transition-summary.patch b/SOURCES/bz2182764-azure-events-1-fix-no-transition-summary.patch new file mode 100644 index 0000000..ed2958e --- /dev/null +++ b/SOURCES/bz2182764-azure-events-1-fix-no-transition-summary.patch @@ -0,0 +1,54 @@ +From 81bb58b05d2ddabd17fe31af39f0e857e61db3c9 Mon Sep 17 00:00:00 2001 +From: Oyvind Albrigtsen +Date: Tue, 28 Mar 2023 16:53:45 +0200 +Subject: [PATCH] azure-events*: fix for no "Transition Summary" for Pacemaker + 2.1+ + +--- + heartbeat/azure-events-az.in | 8 ++++---- + heartbeat/azure-events.in | 6 +++--- + 2 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/heartbeat/azure-events-az.in b/heartbeat/azure-events-az.in +index 59d0953061..67c02c6422 100644 +--- a/heartbeat/azure-events-az.in ++++ b/heartbeat/azure-events-az.in +@@ -311,10 +311,10 @@ class clusterHelper: + summary = clusterHelper._exec("crm_simulate", "-Ls") + if not summary: + ocf.logger.warning("transitionSummary: could not load transition summary") +- return False ++ return "" + if summary.find("Transition Summary:") < 0: +- ocf.logger.warning("transitionSummary: received unexpected transition summary: %s" % summary) +- return False ++ ocf.logger.debug("transitionSummary: no transactions: %s" % summary) ++ return "" + summary = summary.split("Transition Summary:")[1] + ret = summary.split("\n").pop(0) + +@@ -768,4 +768,4 @@ def main(): + agent.run() + + if __name__ == '__main__': +- main() +\ No newline at end of file ++ main() +diff --git a/heartbeat/azure-events.in b/heartbeat/azure-events.in +index 66e129060a..5ad658df93 100644 +--- a/heartbeat/azure-events.in ++++ b/heartbeat/azure-events.in +@@ -310,10 +310,10 @@ class clusterHelper: + summary = clusterHelper._exec("crm_simulate", "-Ls") + if not summary: + ocf.logger.warning("transitionSummary: could not load transition summary") +- return False ++ return "" + if summary.find("Transition Summary:") < 0: +- ocf.logger.warning("transitionSummary: received unexpected transition summary: %s" % summary) +- return False ++ ocf.logger.debug("transitionSummary: no transactions: %s" % summary) ++ return "" + summary = summary.split("Transition Summary:")[1] + ret = summary.split("\n").pop(0) + diff --git a/SOURCES/bz2182764-azure-events-2-improve-logic.patch b/SOURCES/bz2182764-azure-events-2-improve-logic.patch new file mode 100644 index 0000000..1b5aa9d --- /dev/null +++ b/SOURCES/bz2182764-azure-events-2-improve-logic.patch @@ -0,0 +1,77 @@ +From ff53e5c8d6867e580506d132fba6fcf6aa46b804 Mon Sep 17 00:00:00 2001 +From: Peter Varkoly +Date: Sat, 29 Apr 2023 08:09:11 +0200 +Subject: [PATCH] Use -LS instead of -Ls as parameter to get the Transition + Summary + +--- + heartbeat/azure-events-az.in | 9 +++++---- + heartbeat/azure-events.in | 9 +++++---- + 2 files changed, 10 insertions(+), 8 deletions(-) + +diff --git a/heartbeat/azure-events-az.in b/heartbeat/azure-events-az.in +index 67c02c642..46d4d1f3d 100644 +--- a/heartbeat/azure-events-az.in ++++ b/heartbeat/azure-events-az.in +@@ -298,7 +298,7 @@ class clusterHelper: + Get the current Pacemaker transition summary (used to check if all resources are stopped when putting a node standby) + """ + # Is a global crm_simulate "too much"? Or would it be sufficient it there are no planned transitions for a particular node? +- # # crm_simulate -Ls ++ # # crm_simulate -LS + # Transition Summary: + # * Promote rsc_SAPHana_HN1_HDB03:0 (Slave -> Master hsr3-db1) + # * Stop rsc_SAPHana_HN1_HDB03:1 (hsr3-db0) +@@ -308,15 +308,16 @@ class clusterHelper: + # Transition Summary: + ocf.logger.debug("transitionSummary: begin") + +- summary = clusterHelper._exec("crm_simulate", "-Ls") ++ summary = clusterHelper._exec("crm_simulate", "-LS") + if not summary: + ocf.logger.warning("transitionSummary: could not load transition summary") + return "" + if summary.find("Transition Summary:") < 0: + ocf.logger.debug("transitionSummary: no transactions: %s" % summary) + return "" +- summary = summary.split("Transition Summary:")[1] +- ret = summary.split("\n").pop(0) ++ j=summary.find('Transition Summary:') + len('Transition Summary:') ++ l=summary.lower().find('executing cluster transition:') ++ ret = list(filter(str.strip, summary[j:l].split("\n"))) + + ocf.logger.debug("transitionSummary: finished; return = %s" % str(ret)) + return ret +diff --git a/heartbeat/azure-events.in b/heartbeat/azure-events.in +index 5ad658df9..90acaba62 100644 +--- a/heartbeat/azure-events.in ++++ b/heartbeat/azure-events.in +@@ -297,7 +297,7 @@ class clusterHelper: + Get the current Pacemaker transition summary (used to check if all resources are stopped when putting a node standby) + """ + # Is a global crm_simulate "too much"? Or would it be sufficient it there are no planned transitions for a particular node? +- # # crm_simulate -Ls ++ # # crm_simulate -LS + # Transition Summary: + # * Promote rsc_SAPHana_HN1_HDB03:0 (Slave -> Master hsr3-db1) + # * Stop rsc_SAPHana_HN1_HDB03:1 (hsr3-db0) +@@ -307,15 +307,16 @@ class clusterHelper: + # Transition Summary: + ocf.logger.debug("transitionSummary: begin") + +- summary = clusterHelper._exec("crm_simulate", "-Ls") ++ summary = clusterHelper._exec("crm_simulate", "-LS") + if not summary: + ocf.logger.warning("transitionSummary: could not load transition summary") + return "" + if summary.find("Transition Summary:") < 0: + ocf.logger.debug("transitionSummary: no transactions: %s" % summary) + return "" +- summary = summary.split("Transition Summary:")[1] +- ret = summary.split("\n").pop(0) ++ j=summary.find('Transition Summary:') + len('Transition Summary:') ++ l=summary.lower().find('executing cluster transition:') ++ ret = list(filter(str.strip, summary[j:l].split("\n"))) + + ocf.logger.debug("transitionSummary: finished; return = %s" % str(ret)) + return ret diff --git a/SPECS/resource-agents.spec b/SPECS/resource-agents.spec index 2b72748..e2b190f 100644 --- a/SPECS/resource-agents.spec +++ b/SPECS/resource-agents.spec @@ -45,7 +45,7 @@ Name: resource-agents Summary: Open Source HA Reusable Cluster Resource Scripts Version: 4.10.0 -Release: 34%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} +Release: 34%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}.2 License: GPLv2+ and LGPLv2+ URL: https://github.com/ClusterLabs/resource-agents Source0: %{upstream_prefix}-%{upstream_version}.tar.gz @@ -93,6 +93,8 @@ Patch40: bz2157872-2-Filesystem-CTDB-validate-all-improvements.patch Patch41: bz2157872-3-pgsqlms-validate-all-OCF_CHECK_LEVEL-10.patch Patch42: bz2157872-4-exportfs-pgsql-validate-all-fixes.patch Patch43: bz2157872-5-pgsqlms-alidate-all-OCF_CHECK_LEVEL-10.patch +Patch44: bz2182764-azure-events-1-fix-no-transition-summary.patch +Patch45: bz2182764-azure-events-2-improve-logic.patch # bundled ha-cloud-support libs Patch500: ha-cloud-support-aws.patch @@ -204,7 +206,7 @@ in a cluster environment. License: PostgreSQL Summary: PostgreSQL Automatic Failover (PAF) resource agent Requires: %{name} = %{version}-%{release} -Requires: perl-interpreter perl-English perl-FindBin +Requires: perl-interpreter perl-lib perl-English perl-FindBin %description paf PostgreSQL Automatic Failover (PAF) resource agents allows PostgreSQL @@ -260,6 +262,8 @@ exit 1 %patch41 -p1 %patch42 -p1 %patch43 -p1 +%patch44 -p1 +%patch45 -p1 # bundled ha-cloud-support libs %patch500 -p1 @@ -581,6 +585,16 @@ rm -rf %{buildroot}/usr/share/doc/resource-agents %{_usr}/lib/ocf/lib/heartbeat/OCF_*.pm %changelog +* Thu May 25 2023 Oyvind Albrigtsen - 4.10.0-34.2 +- resource-agents-paf: add perl-lib dependency + + Resolves: rhbz#2209702 + +* Mon May 1 2023 Oyvind Albrigtsen - 4.10.0-34.1 +- azure-events*: fix for no "Transition Summary" for Pacemaker 2.1+ + + Resolves: rhbz#2182764 + * Wed Jan 25 2023 Oyvind Albrigtsen - 4.10.0-34 - all agents: dont check notify/promotable settings during validate-action