Fix: openstack-info: Ensure no newlines in openstack_ports
(cherry picked from commit 53cb99938ed90a91affc7c54a103b53239578413)
This commit is contained in:
parent
9809eff87b
commit
f86ce0fff6
59
Fix-openstack-info-Ensure-no-newlines-in-openstack.patch
Normal file
59
Fix-openstack-info-Ensure-no-newlines-in-openstack.patch
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
From 2d5eaf0d97acb0dda6b5f872653ad66dc1dc8c1d Mon Sep 17 00:00:00 2001
|
||||||
|
From: Reid Wahl <nrwahl@protonmail.com>
|
||||||
|
Date: Tue, 26 Mar 2024 20:43:19 -0700
|
||||||
|
Subject: [PATCH] Fix: openstack-info: Ensure no newlines in openstack_ports
|
||||||
|
|
||||||
|
This makes the openstack_ports variable match the format specified in
|
||||||
|
the openstack-info metadata (see longdesc). It should be a
|
||||||
|
comma-separated list of "SUBNET_ID:PORT_ID". It should not be
|
||||||
|
|
||||||
|
SUBNET_A
|
||||||
|
SUBNET_B:PORT_1,SUBNET_C
|
||||||
|
SUBNET_D:PORT_2,
|
||||||
|
|
||||||
|
But rather
|
||||||
|
|
||||||
|
SUBNET_A:PORT1,SUBNET_B:PORT1,SUBNET_C:PORT2,SUBNET_D:PORT2
|
||||||
|
|
||||||
|
The newlines caused parsing issues in an experimental version of
|
||||||
|
Pacemaker. Pacemaker is being fixed
|
||||||
|
(https://github.com/ClusterLabs/pacemaker/pull/3395), but this
|
||||||
|
illustrated an issue in openstack-info that makes parsing rather
|
||||||
|
precarious.
|
||||||
|
|
||||||
|
openstack-virtual-ip is capable of parsing either format without changes
|
||||||
|
on a stable release of Pacemaker.
|
||||||
|
|
||||||
|
However, looking ahead, it should be updated to use
|
||||||
|
"attrd_updater --output-as=xml" to query the attribute, as the XML
|
||||||
|
output is much easier and more reliable to parse. (It should check the
|
||||||
|
Pacemaker feature set to determine whether XML output is available for
|
||||||
|
attrd_updater.)
|
||||||
|
|
||||||
|
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
|
||||||
|
---
|
||||||
|
heartbeat/openstack-info.in | 6 ++++--
|
||||||
|
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/heartbeat/openstack-info.in b/heartbeat/openstack-info.in
|
||||||
|
index 6502f1df..876e833c 100755
|
||||||
|
--- a/heartbeat/openstack-info.in
|
||||||
|
+++ b/heartbeat/openstack-info.in
|
||||||
|
@@ -164,10 +164,12 @@ OSInfoStats() {
|
||||||
|
--format json \
|
||||||
|
--column fixed_ips \
|
||||||
|
${port_id}")
|
||||||
|
- subnet_id=$(echo "$subnet_result" |
|
||||||
|
+ subnet_ids=$(echo "$subnet_result" |
|
||||||
|
grep -P '\"subnet_id\": \".*\",$' |
|
||||||
|
grep -P -o '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}')
|
||||||
|
- value="${value}${subnet_id}:${port_id},"
|
||||||
|
+ for subnet_id in $subnet_ids; do
|
||||||
|
+ value="${value}${subnet_id}:${port_id},"
|
||||||
|
+ done
|
||||||
|
done
|
||||||
|
value=${value%,}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.25.1
|
||||||
|
|
||||||
@ -1,7 +1,7 @@
|
|||||||
Name: resource-agents
|
Name: resource-agents
|
||||||
Summary: Open Source HA Reusable Cluster Resource Scripts
|
Summary: Open Source HA Reusable Cluster Resource Scripts
|
||||||
Version: 4.13.0
|
Version: 4.13.0
|
||||||
Release: 13
|
Release: 14
|
||||||
License: GPLv2+ and LGPLv2+
|
License: GPLv2+ and LGPLv2+
|
||||||
URL: https://github.com/ClusterLabs/resource-agents
|
URL: https://github.com/ClusterLabs/resource-agents
|
||||||
Source0: https://github.com/ClusterLabs/resource-agents/archive/v%{version}.tar.gz
|
Source0: https://github.com/ClusterLabs/resource-agents/archive/v%{version}.tar.gz
|
||||||
@ -18,6 +18,7 @@ Patch0009: Doc-Delay-Drop-old-comments.patch
|
|||||||
Patch0010: portblock-accept-numeric-protocol-from-iptables.patch
|
Patch0010: portblock-accept-numeric-protocol-from-iptables.patch
|
||||||
Patch0011: all-agents-remove-S-state-status-that-are-either-ign.patch
|
Patch0011: all-agents-remove-S-state-status-that-are-either-ign.patch
|
||||||
Patch0012: nfsserver-fix-server-scope-functionality-for-both-po.patch
|
Patch0012: nfsserver-fix-server-scope-functionality-for-both-po.patch
|
||||||
|
Patch0013: Fix-openstack-info-Ensure-no-newlines-in-openstack.patch
|
||||||
Obsoletes: heartbeat-resources <= %{version}
|
Obsoletes: heartbeat-resources <= %{version}
|
||||||
Provides: heartbeat-resources = %{version}
|
Provides: heartbeat-resources = %{version}
|
||||||
BuildRequires: automake autoconf pkgconfig gcc perl-interpreter perl-generators python3-devel
|
BuildRequires: automake autoconf pkgconfig gcc perl-interpreter perl-generators python3-devel
|
||||||
@ -115,6 +116,9 @@ export CFLAGS="$(echo '%{optflags}')"
|
|||||||
%{_mandir}/man8/{ocf-tester.8*,ldirectord.8*}
|
%{_mandir}/man8/{ocf-tester.8*,ldirectord.8*}
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Apr 10 2024 bixiaoyan <bixiaoyan@kylinos.cn> - 4.13.0-14
|
||||||
|
- Fix: openstack-info: Ensure no newlines in openstack_ports
|
||||||
|
|
||||||
* Mon Apr 08 2024 zouzhimin <zouzhimin@kylinos.cn> - 4.13.0-13
|
* Mon Apr 08 2024 zouzhimin <zouzhimin@kylinos.cn> - 4.13.0-13
|
||||||
- nfsserver: fix "server scope" functionality for both potentially other dropins AND multiple ExecStart
|
- nfsserver: fix "server scope" functionality for both potentially other dropins AND multiple ExecStart
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user