Blame SOURCES/bz2012057-Route-return-OCF_NOT_RUNNING-missing-route.patch

e87a70
From 7c54e4ecda33c90a1046c0688774f5b847ab10fe Mon Sep 17 00:00:00 2001
e87a70
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
e87a70
Date: Tue, 7 Dec 2021 10:37:24 +0100
e87a70
Subject: [PATCH] Route: return OCF_NOT_RUNNING for probe action when interface
e87a70
 or route doesnt exist
e87a70
e87a70
---
e87a70
 heartbeat/Route | 15 +++++----------
e87a70
 1 file changed, 5 insertions(+), 10 deletions(-)
e87a70
e87a70
diff --git a/heartbeat/Route b/heartbeat/Route
e87a70
index 8b390615a..7db41d0ae 100755
e87a70
--- a/heartbeat/Route
e87a70
+++ b/heartbeat/Route
e87a70
@@ -227,15 +227,6 @@ route_stop() {
e87a70
 }
e87a70
 
e87a70
 route_status() {
e87a70
-    if [ -n "${OCF_RESKEY_device}" ]; then
e87a70
-	# Must check if device exists or is gone.
e87a70
-	# If device is gone, route is also unconfigured.
e87a70
-	ip link show dev ${OCF_RESKEY_device} >/dev/null 2>&1
e87a70
-	if [ $? -ne 0 ]; then
e87a70
-	    # Assume device does not exist, and short-circuit here.
e87a70
-	    return $OCF_NOT_RUNNING
e87a70
-	fi
e87a70
-    fi
e87a70
     show_output="$(ip $addr_family route show $(create_route_spec) 2>/dev/null)"
e87a70
     if [ $? -eq 0 ]; then
e87a70
 	if [ -n "$show_output" ]; then
e87a70
@@ -251,7 +242,11 @@ route_status() {
e87a70
     else
e87a70
 	# "ip route show" returned an error code. Assume something
e87a70
 	# went wrong.
e87a70
-	return $OCF_ERR_GENERIC
e87a70
+	if ocf_is_probe; then
e87a70
+	    return $OCF_NOT_RUNNING
e87a70
+	else
e87a70
+	    return $OCF_ERR_GENERIC
e87a70
+	fi
e87a70
     fi
e87a70
 }
e87a70