|
|
773311 |
From 5d47f08c60600708aae354b021da9779a9c8e5e6 Mon Sep 17 00:00:00 2001
|
|
|
773311 |
From: Michele Baldessari <michele@acksyn.org>
|
|
|
773311 |
Date: Wed, 3 Jun 2020 14:43:47 +0200
|
|
|
773311 |
Subject: [PATCH] Make the notify() calls work with IPv6 in the OCF
|
|
|
773311 |
resource-agent
|
|
|
773311 |
|
|
|
773311 |
When the VIP is an IPv6 address we get the following error in the
|
|
|
773311 |
resource agent:
|
|
|
773311 |
ovndb_servers_notify_0:355:stderr [ + ovn-sbctl -- --id=@conn_uuid create Connection 'target=ptcp\:6642\:[fd00:fd00:fd00:2000::a2]' inactivity_probe=180000 -- set SB_Global . connections=@conn_uuid ]
|
|
|
773311 |
ovndb_servers_notify_0:355:stderr [ ovn-sbctl: ptcp\:6642\:[fd00:fd00:fd00:2000::a2]: unexpected "[" parsing string ]
|
|
|
773311 |
|
|
|
773311 |
This is because MASTER_IP is an IPv6 address and is being passed to
|
|
|
773311 |
ovn-[ns]bctl without being escaped and the command errors out with
|
|
|
773311 |
unexpected parsing string errors. The rest of the create Connection
|
|
|
773311 |
command was already escaping the columns, we are just missing the ip
|
|
|
773311 |
address bits in case of IPv6.
|
|
|
773311 |
|
|
|
773311 |
Let's make sure we escape the '[]:' characters and avoid this problem.
|
|
|
773311 |
Tested this on an OpenStack environment on both IPv6 and IPv4.
|
|
|
773311 |
|
|
|
773311 |
Signed-off-by: Michele Baldessari <michele@acksyn.org>
|
|
|
773311 |
Signed-off-by: Numan Siddique <numans@ovn.org>
|
|
|
773311 |
---
|
|
|
773311 |
utilities/ovndb-servers.ocf | 4 +++-
|
|
|
773311 |
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
|
773311 |
|
|
|
773311 |
diff --git a/utilities/ovndb-servers.ocf b/utilities/ovndb-servers.ocf
|
|
|
773311 |
index 56c2bc322..7351c7d64 100755
|
|
|
773311 |
--- a/utilities/ovndb-servers.ocf
|
|
|
773311 |
+++ b/utilities/ovndb-servers.ocf
|
|
|
773311 |
@@ -249,7 +249,9 @@ ovsdb_server_notify() {
|
|
|
773311 |
if [ "x${LISTEN_ON_MASTER_IP_ONLY}" = xno ]; then
|
|
|
773311 |
LISTEN_ON_IP="0.0.0.0"
|
|
|
773311 |
else
|
|
|
773311 |
- LISTEN_ON_IP=${MASTER_IP}
|
|
|
773311 |
+ # ovn-[sn]bctl want ':[]' characters to be escaped. We do so in
|
|
|
773311 |
+ # order to make this work when MASTER_IP is an IPv6 address.
|
|
|
773311 |
+ LISTEN_ON_IP=$(sed -e 's/\(\[\|\]\|:\)/\\\1/g' <<< ${MASTER_IP})
|
|
|
773311 |
fi
|
|
|
773311 |
conn=`ovn-nbctl get NB_global . connections`
|
|
|
773311 |
if [ "$conn" == "[]" ]
|
|
|
773311 |
--
|
|
|
773311 |
2.26.2
|
|
|
773311 |
|