File 0015-lio_node-Check-for-iscsi_target_mod.patch of Package lio-utils.216

From 712245de9f21f3f5ce7da7ee7c910a3a7048f38c Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Thu, 17 Apr 2014 09:46:45 +0200
Subject: lio_node: Check for lio_root

The lio_root directory /sys/kernel/config/iscsi has to be
present, otherwise all functions will fail.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 lio-py/lio_node.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lio-py/lio_node.py b/lio-py/lio_node.py
index d58213f..d047fc1 100755
--- a/lio-py/lio_node.py
+++ b/lio-py/lio_node.py
@@ -1293,6 +1293,8 @@ def lio_target_enable_debug(option, opt_str, value, parser):
 	return
 
 def main():
+	if not os.path.isdir(lio_root):
+		lio_err("iscsi_target_mod is not loaded")
 
 	parser = OptionParser()
 	parser.add_option("--addlunacl", action="callback", callback=lio_target_add_lunacl, nargs=5,
-- 
1.8.1.4

openSUSE Build Service is sponsored by