File 0121-lio-dump-Add-iser-network-portal-attribute-support.patch of Package lio-utils.216

From a8de60664dd259d1e613be719c02cfdab44bf00c Mon Sep 17 00:00:00 2001
From: Nicholas Bellinger <nab@risingtidesystems.com>
Date: Thu, 11 Apr 2013 20:33:40 -0700
Subject: lio-dump: Add iser network portal attribute support

Signed-off-by: Nicholas Bellinger <nab@risingtidesystems.com>
---
 lio-py/lio_dump.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lio-py/lio_dump.py b/lio-py/lio_dump.py
index 6328161..3e3461f 100755
--- a/lio-py/lio_dump.py
+++ b/lio-py/lio_dump.py
@@ -57,7 +57,15 @@ def lio_target_configfs_dump(option, opt_str, value, parser):
 			print "#### Network portals for iSCSI Target Portal Group"
 			np_root = os.listdir(lio_root + "/" + iqn + "/tpgt_" + tpgt + "/np")
 			for np in np_root:
-				print "mkdir -p " + lio_root + "/" + iqn + "/tpgt_" + tpgt + "/np/" + np
+				np_path = lio_root + "/" + iqn + "/tpgt_" + tpgt + "/np/" + np
+				print "mkdir -p " + np_path
+				np_path_iser = np_path + "/iser"
+				if os.path.isfile(np_path_iser):
+					iser_fd = open(np_path_iser, 'r')
+					iser_attr = iser_fd.read()
+					iser_attr = iser_attr.strip()
+					if iser_attr == "1":
+						print "echo 1 > " + np_path_iser
 
 			print "#### iSCSI Target Ports"
 			lun_root = os.listdir(lio_root + "/" + iqn + "/tpgt_" + tpgt + "/lun")
-- 
1.8.1.4

openSUSE Build Service is sponsored by