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

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