Blame SOURCES/bz1102727-3-fence_mpath.patch

44709c
From 39eb1ed82067d6c720bff3be5af08acedd85ef04 Mon Sep 17 00:00:00 2001
44709c
From: Marek 'marx' Grac <mgrac@redhat.com>
44709c
Date: Wed, 12 Aug 2015 15:08:30 +0200
44709c
Subject: [PATCH] fence_mpath: Fix unfencing problems when /var/run/cluster is
44709c
 removed and monitor these files
44709c
44709c
This patch solves same problem as 2f1be046c0c880ec14caff2193b4daa18bcecab7 and 5b3c2b26e5dfa4784d44ac875c7780495bacdde8
44709c
for fence_scsi.
44709c
---
44709c
 fence/agents/mpath/fence_mpath.py | 10 +++++++---
44709c
 1 file changed, 7 insertions(+), 3 deletions(-)
44709c
44709c
diff --git a/fence/agents/mpath/fence_mpath.py b/fence/agents/mpath/fence_mpath.py
44709c
index 6992dc7..2d1e218 100644
44709c
--- a/fence/agents/mpath/fence_mpath.py
44709c
+++ b/fence/agents/mpath/fence_mpath.py
44709c
@@ -26,6 +26,10 @@ def get_status(conn, options):
44709c
 		else:
44709c
 			logging.debug("No registration for key "\
44709c
 				+ options["--key"] + " on device " + dev + "\n")
44709c
+
44709c
+	if options["--action"] == "monitor":
44709c
+		dev_read(options)
44709c
+
44709c
 	return status
44709c
 
44709c
 
44709c
@@ -133,8 +137,8 @@ def get_registration_keys(options, dev):
44709c
 def dev_write(options, dev):
44709c
 	file_path = options["--store-path"] + "/mpath.devices"
44709c
 
44709c
-	if not os.path.isdir(os.path.dirname(options["--store-path"])):
44709c
-		os.makedirs(os.path.dirname(options["--store-path"]))
44709c
+	if not os.path.isdir(options["--store-path"]):
44709c
+		os.makedirs(options["--store-path"])
44709c
 
44709c
 	try:
44709c
 		store_fh = open(file_path, "a+")
44709c
@@ -203,7 +207,7 @@ def main():
44709c
 	atexit.register(atexit_handler)
44709c
 
44709c
 	device_opt = ["no_login", "no_password", "devices", "key", "sudo", \
44709c
-	        "fabric_fencing", "on_target", "store_path", "mpathpersist_path"]
44709c
+	        "fabric_fencing", "on_target", "store_path", "mpathpersist_path", "force_on"]
44709c
 
44709c
 	define_new_opts()
44709c
 
44709c
-- 
44709c
1.9.3
44709c