summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Grover <agrover@redhat.com>2013-07-18 10:13:22 -0700
committerAndy Grover <agrover@redhat.com>2013-07-18 11:18:30 -0700
commit6071702ac32cf3ba7bd3da3747bd80ad1498a27c (patch)
treebbe707009e7d8eb5a6a3ff420c7429a4d1b430b5
parent0776de565fd3f60c4c9307441d29494cab3f17bb (diff)
downloadrtslib-fb-6071702ac32cf3ba7bd3da3747bd80ad1498a27c.tar.gz
Rename 'acls_auth' feature to 'auth'
This feature now includes TPG auth, so the name no longer fit. Signed-off-by: Andy Grover <agrover@redhat.com>
-rw-r--r--rtslib/fabric.py14
-rw-r--r--rtslib/target.py4
2 files changed, 11 insertions, 7 deletions
diff --git a/rtslib/fabric.py b/rtslib/fabric.py
index 655c8ab..5775424 100644
--- a/rtslib/fabric.py
+++ b/rtslib/fabric.py
@@ -27,8 +27,8 @@ Available parameters
* features
Lists the target fabric available features. Default value:
-("discovery_auth", "acls", "acls_auth", "nps")
-example: features = ("discovery_auth", "acls", "acls_auth")
+("discovery_auth", "acls", "auth", "nps")
+example: features = ("discovery_auth", "acls", "auth")
example: features = () # no features supported
Detail of features:
@@ -43,8 +43,9 @@ Detail of features:
* acls
The target's TPGTs support explicit initiator ACLs.
- * acls_auth
- The target's TPGT's ACLs support per-ACL initiator authentication.
+ * auth
+ The target's TPGT's support per-TPG authentication, and
+ the target's TPGT's ACLs support per-ACL initiator authentication.
* nps
The TPGTs support iSCSI-like IPv4/IPv6 network portals, using IP:PORT
@@ -138,7 +139,7 @@ class _BaseFabricModule(CFSNode):
self.name = str(name)
self.spec_file = "N/A"
self._path = "%s/%s" % (self.configfs_dir, self.name)
- self.features = ('discovery_auth', 'acls', 'acls_auth', 'nps', 'tpgts')
+ self.features = ('discovery_auth', 'acls', 'auth', 'nps', 'tpgts')
self.wwn_types = ('free',)
self.kernel_module = "%s_target_mod" % self.name
@@ -151,6 +152,9 @@ class _BaseFabricModule(CFSNode):
super(_BaseFabricModule, self)._check_self()
def has_feature(self, feature):
+ # Handle a renamed feature
+ if feature == 'acls_auth':
+ feature = 'auth'
return feature in self.features
def _list_targets(self):
diff --git a/rtslib/target.py b/rtslib/target.py
index 92668a5..7410588 100644
--- a/rtslib/target.py
+++ b/rtslib/target.py
@@ -489,7 +489,7 @@ class TPG(CFSNode):
d['luns'] = [lun.dump() for lun in self.luns]
d['portals'] = [portal.dump() for portal in self.network_portals]
d['node_acls'] = [acl.dump() for acl in self.node_acls]
- if self.has_feature("acls_auth"):
+ if self.has_feature("auth"):
for attr in ("userid", "password", "mutual_userid", "mutual_password"):
val = getattr(self, "chap_" + attr, None)
if val:
@@ -951,7 +951,7 @@ class NodeACL(CFSNode):
d['mapped_luns'] = [lun.dump() for lun in self.mapped_luns]
if self.tag:
d['tag'] = self.tag
- if self.has_feature("acls_auth"):
+ if self.has_feature("auth"):
for attr in ("userid", "password", "mutual_userid", "mutual_password"):
val = getattr(self, "chap_" + attr, None)
if val: