Blame SOURCES/bz1751704-fence_mpath-fix-watchdog-trigger-multipath-disconnect.patch

6147c0
From 2df8abf25eddc8da71c193ca29f6be51e66b02f0 Mon Sep 17 00:00:00 2001
6147c0
From: Hideo Yamauchi <renayama19661014@ybb.ne.jp>
6147c0
Date: Thu, 12 Sep 2019 08:44:49 +0900
6147c0
Subject: [PATCH] High: mpath: Correction of failure detection behavior from
6147c0
 watchdog service.
6147c0
6147c0
---
6147c0
 agents/mpath/fence_mpath.py | 8 +++++---
6147c0
 1 file changed, 5 insertions(+), 3 deletions(-)
6147c0
6147c0
diff --git a/agents/mpath/fence_mpath.py b/agents/mpath/fence_mpath.py
6147c0
index e4f59836..b17388eb 100644
6147c0
--- a/agents/mpath/fence_mpath.py
6147c0
+++ b/agents/mpath/fence_mpath.py
6147c0
@@ -117,12 +117,14 @@ def get_reservation_key(options, dev):
6147c0
 	match = re.search(r"\s+key\s*=\s*0x(\S+)\s+", out["out"], re.IGNORECASE)
6147c0
 	return match.group(1) if match else None
6147c0
 
6147c0
-def get_registration_keys(options, dev):
6147c0
+def get_registration_keys(options, dev, fail=True):
6147c0
 	keys = []
6147c0
 	cmd = options["--mpathpersist-path"] + " -i -k -d " + dev
6147c0
 	out = run_cmd(options, cmd)
6147c0
 	if out["err"]:
6147c0
-		fail_usage("Cannot get registration keys")
6147c0
+		fail_usage("Cannot get registration keys", fail)
6147c0
+		if not fail:
6147c0
+			return []
6147c0
 	for line in out["out"].split("\n"):
6147c0
 		match = re.search(r"\s+0x(\S+)\s*", line)
6147c0
 		if match:
6147c0
@@ -183,7 +185,7 @@ def mpath_check(hardreboot=False):
6147c0
 		logging.error("No devices found")
6147c0
 		return 0
6147c0
 	for dev, key in list(devs.items()):
6147c0
-		if key in get_registration_keys(options, dev):
6147c0
+		if key in get_registration_keys(options, dev, fail=False):
6147c0
 			logging.debug("key " + key + " registered with device " + dev)
6147c0
 			return 0
6147c0
 		else: