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

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