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

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