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

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