summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Grover <agrover@redhat.com>2012-01-10 22:39:50 -0800
committerAndy Grover <agrover@redhat.com>2012-01-10 22:43:31 -0800
commit1a3d2e2a24a9914d5cb5cb22240b7d7206c88d7a (patch)
tree0346caf3dce8b90ea00d0c9a88a717efc59151ce
parent26c5f4038d3299de4d2b04ac741c80ac0d8552e0 (diff)
downloadrtslib-fb-1a3d2e2a24a9914d5cb5cb22240b7d7206c88d7a.tar.gz
Clear fabric discovery auth settings from clearconfigv2.1.fb3
It's a little different from the other object types. Return an int from _get_discovery_enable_auth so it evaluates to false if 0 ("0" returns true, not what we want.) Signed-off-by: Andy Grover <agrover@redhat.com>
-rw-r--r--rtslib/root.py2
-rw-r--r--rtslib/target.py11
2 files changed, 12 insertions, 1 deletions
diff --git a/rtslib/root.py b/rtslib/root.py
index 29ed577..2e3a10d 100644
--- a/rtslib/root.py
+++ b/rtslib/root.py
@@ -179,6 +179,8 @@ class RTSRoot(CFSNode):
# Deleting backstores deletes associated storageobjects.
for t in self.targets:
t.delete()
+ for fm in (f for f in self.fabric_modules if f.has_feature("discovery_auth")):
+ fm.clear_discovery_auth_settings()
for bs in self.backstores:
bs.delete()
diff --git a/rtslib/target.py b/rtslib/target.py
index 0be96b2..61d3fa7 100644
--- a/rtslib/target.py
+++ b/rtslib/target.py
@@ -234,6 +234,15 @@ class FabricModule(CFSNode):
raise RTSLibError("This fabric module does not implement "
+ "the %s feature." % feature)
+ def clear_discovery_auth_settings(self):
+ self._check_self()
+ self._assert_feature('discovery_auth')
+ self.discovery_mutual_password = ''
+ self.discovery_mutual_userid = ''
+ self.discovery_password = ''
+ self.discovery_userid = ''
+ self.discovery_enable_auth = False
+
def _get_discovery_mutual_password(self):
self._check_self()
self._assert_feature('discovery_auth')
@@ -311,7 +320,7 @@ class FabricModule(CFSNode):
self._assert_feature('discovery_auth')
path = "%s/discovery_auth/enforce_discovery_auth" % self.path
value = fread(path).strip()
- return value
+ return int(value)
def _set_discovery_enable_auth(self, enable):
self._check_self()