summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Dewender <github@JonnyJD.net>2012-03-14 15:45:01 +0100
committerJohannes Dewender <github@JonnyJD.net>2012-03-14 15:49:21 +0100
commit4a0b8c019628a72570c539b3f6b386c4fe5ccfc3 (patch)
tree40383d8d4de843154d74135db5a0617ebed8e894
parent68acfd2a2fcd7ed63f550adc5ebee222a4cb29d3 (diff)
downloadrtslib-fb-4a0b8c019628a72570c539b3f6b386c4fe5ccfc3.tar.gz
sessions: document public variables; None for defaults
Instance variables without docstrings won't show up at all with epydoc. Should be consistent with None vs. "" as default here. Signed-off-by: Johannes Dewender <github@JonnyJD.net>
-rw-r--r--rtslib/target.py22
1 files changed, 17 insertions, 5 deletions
diff --git a/rtslib/target.py b/rtslib/target.py
index f8392ca..50def9c 100644
--- a/rtslib/target.py
+++ b/rtslib/target.py
@@ -968,20 +968,26 @@ class Session(object):
@param parent_nodeacl: The parent acl
@type parent_nodeacl: L{NodeACL}
'''
+
# default values, if none are found in the info
- self.alias = "" # initiator alias
+ self.exists = True
+ '''existence of session info in the configfs
+ @type: C{bool}
+ '''
+
+ self.alias = None
'''initiator alias
@type: C{str}
'''
- self.id = ""
+ self.id = None
'''LIO session id
@type: C{int}
'''
- self.type = ""
+ self.type = None
'''session type
@type: C{str}
'''
- self.state = ""
+ self.state = None
'''session state
@type: C{str}
'''
@@ -992,6 +998,9 @@ class Session(object):
if isinstance(parent_nodeacl, NodeACL):
self.parent_nodeacl = parent_nodeacl
+ '''parent acl
+ @type: L{NodeACL}
+ '''
if not parent_nodeacl.exists:
raise RTSLibError("The parent_nodeacl does not exist.")
else:
@@ -1004,7 +1013,6 @@ class Session(object):
self.exists = False
return
- self.exists = True
if line.startswith("InitiatorName:"):
pass # the same as in the acl already
elif line.startswith("InitiatorAlias:"):
@@ -1046,6 +1054,10 @@ class Connection(object):
'''ip address of the initiator
@type: C{str}
'''
+ self.transport = None
+ '''transport protocol used
+ @type: C{str}
+ '''
class NetworkPortal(CFSNode):