Blame SOURCES/bz1908146-bz1908147-bz1949114-openstack-agents-fixes.patch

e1b3f1
From 64f434014bc198055478a139532c7cc133967c5d Mon Sep 17 00:00:00 2001
e1b3f1
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
e1b3f1
Date: Fri, 8 Jul 2022 15:41:34 +0200
e1b3f1
Subject: [PATCH] openstack-agents: fixes
e1b3f1
e1b3f1
- openstack-cinder-volume: dont do volume_local_check during start/stop-action
e1b3f1
- openstack-floating-ip/openstack-virtual-ip: dont fail in validate()
e1b3f1
  during probe-calls
e1b3f1
- openstack-floating-ip: fix awk only catching last id for node_port_ids
e1b3f1
---
e1b3f1
 heartbeat/openstack-cinder-volume | 2 +-
e1b3f1
 heartbeat/openstack-floating-ip   | 4 ++--
e1b3f1
 heartbeat/openstack-virtual-ip    | 4 ++--
e1b3f1
 3 files changed, 5 insertions(+), 5 deletions(-)
e1b3f1
e1b3f1
diff --git a/heartbeat/openstack-cinder-volume b/heartbeat/openstack-cinder-volume
e1b3f1
index cc12e58ae..19bf04faf 100755
e1b3f1
--- a/heartbeat/openstack-cinder-volume
e1b3f1
+++ b/heartbeat/openstack-cinder-volume
e1b3f1
@@ -138,7 +138,7 @@ osvol_monitor() {
e1b3f1
 
e1b3f1
 	node_id=$(_get_node_id)
e1b3f1
 
e1b3f1
-	if ocf_is_true $OCF_RESKEY_volume_local_check ; then
e1b3f1
+	if [ "$__OCF_ACTION" = "monitor" ] && ocf_is_true $OCF_RESKEY_volume_local_check ; then
e1b3f1
 		#
e1b3f1
 		# Is the volue attached?
e1b3f1
 		# We check the local devices
e1b3f1
diff --git a/heartbeat/openstack-floating-ip b/heartbeat/openstack-floating-ip
e1b3f1
index 8c135cc24..6e2895654 100755
e1b3f1
--- a/heartbeat/openstack-floating-ip
e1b3f1
+++ b/heartbeat/openstack-floating-ip
e1b3f1
@@ -111,7 +111,7 @@ osflip_validate() {
e1b3f1
 	fi
e1b3f1
 
e1b3f1
 	${HA_SBIN_DIR}/attrd_updater --query -n openstack_ports -N $(crm_node -n) > /dev/null 2>&1
e1b3f1
-	if [ $? -ne 0 ] ; then
e1b3f1
+	if [ $? -ne 0 ] && ! ocf_is_probe; then
e1b3f1
 		ocf_log warn "attr_updater failed to get openstack_ports attribute of node $OCF_RESOURCE_INSTANCE"
e1b3f1
 		return $OCF_ERR_GENERIC
e1b3f1
 	fi
e1b3f1
@@ -129,7 +129,7 @@ osflip_monitor() {
e1b3f1
 	node_port_ids=$(${HA_SBIN_DIR}/attrd_updater --query -n openstack_ports -N $(crm_node -n) \
e1b3f1
 		| awk -F= '{gsub("\"","");print $NF}' \
e1b3f1
 		| tr ',' ' ' \
e1b3f1
-		| awk -F: '{print $NF}')
e1b3f1
+		| awk '{gsub("[^ ]*:", "");print}')
e1b3f1
 
e1b3f1
 	# Is the IP active and attached?
e1b3f1
 	result=$($OCF_RESKEY_openstackcli floating ip show \
e1b3f1
diff --git a/heartbeat/openstack-virtual-ip b/heartbeat/openstack-virtual-ip
e1b3f1
index a1084c420..c654d980a 100755
e1b3f1
--- a/heartbeat/openstack-virtual-ip
e1b3f1
+++ b/heartbeat/openstack-virtual-ip
e1b3f1
@@ -119,7 +119,7 @@ osvip_validate() {
e1b3f1
 	get_config
e1b3f1
 
e1b3f1
 	${HA_SBIN_DIR}/attrd_updater --query -n openstack_ports -N $(crm_node -n) > /dev/null 2>&1
e1b3f1
-	if [ $? -ne 0 ] ; then
e1b3f1
+	if [ $? -ne 0 ] && ! ocf_is_probe; then
e1b3f1
 		ocf_log warn "attr_updater failed to get openstack_ports attribute of node $OCF_RESOURCE_INSTANCE"
e1b3f1
 		return $OCF_ERR_GENERIC
e1b3f1
 	fi
e1b3f1
@@ -136,7 +136,7 @@ osvip_monitor() {
e1b3f1
 		--format value \
e1b3f1
 		--column allowed_address_pairs \
e1b3f1
 		${node_port_id})
e1b3f1
-	if echo $result | grep -q $OCF_RESKEY_ip ; then
e1b3f1
+	if echo $result | grep -q "$OCF_RESKEY_ip"; then
e1b3f1
 		${HA_SBIN_DIR}/attrd_updater ${OCF_RESKEY_delay} -S status -n openstack_virtual_ip -v $OCF_RESKEY_ip
e1b3f1
 
e1b3f1
 		return $OCF_SUCCESS