From 5282f7f54beacee4a81351f08caf93deffe29e4f Mon Sep 17 00:00:00 2001 From: zhangxingrong Date: Mon, 19 Aug 2024 14:02:19 +0800 Subject: [PATCH] add some patchs (cherry picked from commit be70266de609e99dbaaded9246a707deb96c04e4) --- backport-IPaddr2-Fix-bringing-up-device.patch | 55 +++++++++++++++++++ ...ix-spelling-of-adresses-to-addresses.patch | 25 +++++++++ resource-agents.spec | 10 +++- 3 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 backport-IPaddr2-Fix-bringing-up-device.patch create mode 100644 backport-azure-lb-fix-spelling-of-adresses-to-addresses.patch diff --git a/backport-IPaddr2-Fix-bringing-up-device.patch b/backport-IPaddr2-Fix-bringing-up-device.patch new file mode 100644 index 0000000..6c27996 --- /dev/null +++ b/backport-IPaddr2-Fix-bringing-up-device.patch @@ -0,0 +1,55 @@ +From 82045adbe11db0288bfe27d34f59e85948483f34 Mon Sep 17 00:00:00 2001 +From: edmund-haefele +Date: Tue, 13 Aug 2024 09:22:37 +0000 +Subject: [PATCH] powervs-subnet: Modify gathering of Apikey, calculation of + timeout. + +--- + heartbeat/powervs-subnet.in | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +diff --git a/heartbeat/powervs-subnet.in b/heartbeat/powervs-subnet.in +index 3d86ae7c9..ec59d5b07 100755 +--- a/heartbeat/powervs-subnet.in ++++ b/heartbeat/powervs-subnet.in +@@ -24,6 +24,7 @@ + + import ipaddress + import json ++import math + import os + import re + import socket +@@ -175,8 +176,7 @@ class nmcli: + + ocf.logger.debug(f"wait_for_nic: args: mac: {mac}, timeout: {timeout} s") + mac_address = mac.upper() +- retries = (timeout // cls._WAIT_FOR_NIC_SLEEP) - 1 +- ++ retries = math.ceil((timeout * 0.95) / cls._WAIT_FOR_NIC_SLEEP) - 1 + for attempt in range(1, retries + 1): + try: + ocf.logger.debug( +@@ -363,8 +363,11 @@ class PowerCloudAPI: + try: + keys = json.loads(f.read()) + # data seems to be in json format +- # return the value of the item with the key 'apikey' +- api_key = keys.get("apikey", keys) ++ # return the value of the item with the key 'Apikey' ++ # backward compatibility: In the past, the key name was 'apikey' ++ api_key = keys.get("Apikey", "") ++ if not api_key: ++ api_key = keys.get("apikey", "") + except ValueError: + # data is text, return as is + api_key = f.read().strip() +@@ -979,7 +982,7 @@ def main(): + "powervs-subnet", + shortdesc="Manages moving a Power Virtual Server subnet", + longdesc=agent_description, +- version=1.01, ++ version=1.02, + ) + + agent.add_parameter( diff --git a/backport-azure-lb-fix-spelling-of-adresses-to-addresses.patch b/backport-azure-lb-fix-spelling-of-adresses-to-addresses.patch new file mode 100644 index 0000000..2ecc5cb --- /dev/null +++ b/backport-azure-lb-fix-spelling-of-adresses-to-addresses.patch @@ -0,0 +1,25 @@ +From b9d48abfbc6042767bf6610b61f4c1656d79ee40 Mon Sep 17 00:00:00 2001 +From: Valentin Vidic +Date: Sun, 28 Jul 2024 19:19:01 +0200 +Subject: [PATCH] azure-lb: fix spelling of adresses to addresses + +--- + heartbeat/azure-lb | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/heartbeat/azure-lb b/heartbeat/azure-lb +index 64225264b..adfc61e9e 100755 +--- a/heartbeat/azure-lb ++++ b/heartbeat/azure-lb +@@ -86,9 +86,9 @@ default: Neither -4 nor -6 will be used. The default behavior of socat and nc wi + If net.ipv6.bindv6only = 1 => Listen only on IPv4 addresses + ipv4only: Listen only on IPv4 addresses. + ipv6enable: Enable TCP6 support. +- nc: Listen only on IPv6 adresses independent of net.ipv6.bindv6only ++ nc: Listen only on IPv6 addresses independent of net.ipv6.bindv6only + socat: If net.ipv6.bindv6only = 0 => Listen on both IPv4 and IP6 addresses. +- If net.ipv6.bindv6only = 1 => Listen only on IPv6 adresses. ++ If net.ipv6.bindv6only = 1 => Listen only on IPv6 addresses. + + Usage of IPv4 and IPv6 addresses. + diff --git a/resource-agents.spec b/resource-agents.spec index 51e2581..0c352b0 100644 --- a/resource-agents.spec +++ b/resource-agents.spec @@ -1,10 +1,14 @@ Name: resource-agents Summary: Open Source HA Reusable Cluster Resource Scripts Version: 4.15.1 -Release: 1 +Release: 2 License: GPLv2+ and LGPLv2+ URL: https://github.com/ClusterLabs/resource-agents Source0: https://github.com/ClusterLabs/resource-agents/archive/v%{version}.tar.gz + +Patch0: backport-IPaddr2-Fix-bringing-up-device.patch +Patch1: backport-azure-lb-fix-spelling-of-adresses-to-addresses.patch + Obsoletes: heartbeat-resources <= %{version} Provides: heartbeat-resources = %{version} BuildRequires: automake autoconf pkgconfig gcc perl-interpreter perl-generators python3-devel @@ -102,6 +106,10 @@ export CFLAGS="$(echo '%{optflags}')" %{_mandir}/man8/{ocf-tester.8*,ldirectord.8*} %changelog +* Mon Aug 19 2024 zhangxingrong - 4.15.1-2 +- IPaddr2: Fix bringing up device +- azure-lb: fix spelling of adresses to addresses + * Mon Aug 05 2024 zouzhimin - 4.15.1-1 - update to 4.15.1 - IPaddr2: dont fail with "IPv4 does not support lvs_ipv6_addrlabel" -- Gitee