[PATCH 2/2] rtslib: Add NetworkPortal delete to disable iser attribute

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

 



From: Nicholas Bellinger <nab@xxxxxxxxxxxxxxxxxxxxx>

Signed-off-by: Nicholas Bellinger <nab@xxxxxxxxxxxxxxxxxxxxx>
---
 rtslib/target.py |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/rtslib/target.py b/rtslib/target.py
index 59aabcb..6d46a64 100644
--- a/rtslib/target.py
+++ b/rtslib/target.py
@@ -886,6 +886,17 @@ class NetworkPortal(CFSNode):
 
     # NetworkPortal public stuff
 
+    def delete(self):
+        '''
+        Delete the NetworkPortal.
+        '''
+        path = "%s/iser" % self.path
+        if os.path.isfile(path):
+            iser_attr = fread(path).strip()
+            if iser_attr == "1":
+                fwrite(path, "0")
+        super(NetworkPortal, self).delete()
+
     parent_tpg = property(_get_parent_tpg,
             doc="Get the parent TPG object.")
     port = property(_get_port,
-- 
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