summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Dewender <github@JonnyJD.net>2012-03-09 03:22:53 +0100
committerJohannes Dewender <github@JonnyJD.net>2012-03-09 13:36:48 +0100
commit5e88ec215548a1f990df3eb4d70bb9a2fbafc686 (patch)
tree20d8da051c4aaa72ceab3edf1f42e2a725499201
parent274e85dea54ff7f5742b7d83572ce59db6aa7174 (diff)
downloadrtslib-fb-5e88ec215548a1f990df3eb4d70bb9a2fbafc686.tar.gz
Add session to the NodeACL interface, re #10
This gives a snapshot of the current session or None if there is no open session. Signed-off-by: Johannes Dewender <github@JonnyJD.net>
-rw-r--r--rtslib/target.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/rtslib/target.py b/rtslib/target.py
index c894c84..71a59f4 100644
--- a/rtslib/target.py
+++ b/rtslib/target.py
@@ -879,6 +879,9 @@ class NodeACL(CFSNode):
mapped_lun = int(os.path.basename(mapped_lun_dir).split("_")[1])
yield MappedLUN(self, mapped_lun)
+ def _get_session(self):
+ return Session(self)
+
# NodeACL public stuff
def has_feature(self, feature):
'''
@@ -929,6 +932,9 @@ class NodeACL(CFSNode):
doc="Get the boolean authenticate target flag.")
mapped_luns = property(_list_mapped_luns,
doc="Get the list of all MappedLUN objects in this NodeACL.")
+ session = property(_get_session,
+ doc="Gives a snapshot of the current session or C{None}")
+ '''@type: L{Session}'''
def dump(self):
d = super(NodeACL, self).dump()