Blame SOURCES/aws-vpc-move-ip-2-avoid-false-positive-monitor.patch

b4b3ce
From 42dccdd20aff3ebf134c8041f79ab0a658975e69 Mon Sep 17 00:00:00 2001
b4b3ce
From: =?UTF-8?q?Michal=20Koutn=C3=BD?= <mkoutny@suse.com>
b4b3ce
Date: Thu, 30 Aug 2018 18:02:51 +0200
b4b3ce
Subject: [PATCH] aws-vpc-move-ip: Fix broken shell quoting
b4b3ce
b4b3ce
The argument 4th to `ip` is passed with single quotes around which
b4b3ce
cannot be parsed as valid IP address. Furthermore, we need to expand the
b4b3ce
$OCF_RESKEY_ip for grep. This breaks correct detection of the assigned
b4b3ce
address.
b4b3ce
b4b3ce
Fixes 7632a85bcf642b484df52a25dbffbfa0031421bc.
b4b3ce
---
b4b3ce
 heartbeat/aws-vpc-move-ip | 4 ++--
b4b3ce
 1 file changed, 2 insertions(+), 2 deletions(-)
b4b3ce
b4b3ce
diff --git a/heartbeat/aws-vpc-move-ip b/heartbeat/aws-vpc-move-ip
b4b3ce
index 3bbbed474..ce3fc6b9a 100755
b4b3ce
--- a/heartbeat/aws-vpc-move-ip
b4b3ce
+++ b/heartbeat/aws-vpc-move-ip
b4b3ce
@@ -167,9 +167,9 @@ ec2ip_monitor() {
b4b3ce
 		ocf_log debug "monitor: Enhanced Monitoring disabled - omitting API call"
b4b3ce
 	fi
b4b3ce
 
b4b3ce
-	cmd="ip addr show to '$OCF_RESKEY_ip' up"
b4b3ce
+	cmd="ip addr show to $OCF_RESKEY_ip up"
b4b3ce
 	ocf_log debug "executing command: $cmd"
b4b3ce
-	RESULT=$($cmd | grep '$OCF_RESKEY_ip')
b4b3ce
+	RESULT=$($cmd | grep "$OCF_RESKEY_ip")
b4b3ce
 	if [ -z "$RESULT" ]; then
b4b3ce
 		ocf_log warn "IP $OCF_RESKEY_ip not assigned to running interface"
b4b3ce
 		return $OCF_NOT_RUNNING