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

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