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