Blame SOURCES/bz1243485-2-fence_scsi-monitor.patch

e4ffb1
From 4a095f8d70ef90a50ed59917cca6874a3db1a433 Mon Sep 17 00:00:00 2001
e4ffb1
From: Marek 'marx' Grac <mgrac@redhat.com>
e4ffb1
Date: Thu, 16 Jul 2015 09:28:15 +0200
e4ffb1
Subject: [PATCH 2/2] fence_scsi: Monitor action checks also existence of files
e4ffb1
 with SCSI keys
e4ffb1
e4ffb1
---
e4ffb1
 fence/agents/scsi/fence_scsi.py | 6 ++++++
e4ffb1
 1 file changed, 6 insertions(+)
e4ffb1
e4ffb1
diff --git a/fence/agents/scsi/fence_scsi.py b/fence/agents/scsi/fence_scsi.py
e4ffb1
index 445c5f8..7e7bc0d 100644
e4ffb1
--- a/fence/agents/scsi/fence_scsi.py
e4ffb1
+++ b/fence/agents/scsi/fence_scsi.py
e4ffb1
@@ -88,6 +88,7 @@ def set_status(conn, options):
e4ffb1
 
e4ffb1
 # check if host is ready to execute actions
e4ffb1
 def do_action_monitor(options):
e4ffb1
+	# Check if required binaries are installed
e4ffb1
 	if bool(run_cmd(options, options["--sg_persist-path"] + " -V")["err"]):
e4ffb1
 		logging.error("Unable to run " + options["--sg_persist-path"])
e4ffb1
 		return 1
e4ffb1
@@ -98,6 +99,11 @@ def do_action_monitor(options):
e4ffb1
 			bool(run_cmd(options,	options["--vgs-path"] + " --version")["err"])):
e4ffb1
 		logging.error("Unable to run " + options["--vgs-path"])
e4ffb1
 		return 1
e4ffb1
+
e4ffb1
+	# Keys have to be present in order to fence/unfence
e4ffb1
+	get_key()
e4ffb1
+	dev_read()
e4ffb1
+
e4ffb1
 	return 0
e4ffb1
 
e4ffb1
 
e4ffb1
-- 
e4ffb1
1.9.3
e4ffb1