[PATCH 2/2] lio-dump: Add iser network portal attribute support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Nicholas Bellinger <nab@xxxxxxxxxxxxxxxxxxxxx>

Signed-off-by: Nicholas Bellinger <nab@xxxxxxxxxxxxxxxxxxxxx>
---
 lio-py/lio_dump.py |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

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.7.2.5

--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux