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

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