[PATCH] targetcli: Add support for iser network portal attribute in UIPortal class

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

 



From: Nicholas Bellinger <nab@xxxxxxxxxxxxxxxxxxxxx>

Signed-off-by: Nicholas Bellinger <nab@xxxxxxxxxxxxxxxxxxxxx>
---
 targetcli/ui_target.py |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/targetcli/ui_target.py b/targetcli/ui_target.py
index f7eec49..b9ccf8d 100644
--- a/targetcli/ui_target.py
+++ b/targetcli/ui_target.py
@@ -1023,8 +1023,31 @@ class UIPortal(UIRTSLibNode):
         name = "%s:%s" % (portal.ip_address, portal.port)
         UIRTSLibNode.__init__(self, name, portal, parent)
         self.cfs_cwd = portal.path
+        self.portal = portal
         self.refresh()
 
     def summary(self):
-        return ('', True)
+        if self.portal._get_iser_attr():
+            return ('OK, iser enabled', True)
+        else:
+            return ('OK, iser disabled', True)
+
+    def ui_command_iser_enable(self):
+        '''
+        Enables iser operation on an network portal.
+        '''
+        if self.portal._get_iser_attr() == True:
+            self.shell.log.info("iser operation has already been enabled")
+        else:
+            self.portal._set_iser_attr(True)
+            self.shell.log.info("iser operation has been enabled")
 
+    def ui_command_iser_disable(self):
+        '''
+        Disabled iser operation on an network portal.
+        '''
+        if self.portal._get_iser_attr() == False:
+            self.shell.log.info("iser operation has already been disabled")
+        else:
+            self.portal._set_iser_attr(False)
+            self.shell.log.info("iser operation has been disabled")
-- 
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