summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Grover <agrover@redhat.com>2014-01-08 15:59:58 -0800
committerAndy Grover <agrover@redhat.com>2014-01-08 15:59:58 -0800
commit13ee44f02dc5c88253896792032f5e1c5fe4f885 (patch)
tree9a43086bc98c2c49034601b554a9a3ee32ee5689
parent9fa8e9f253206a6b28b025967c2bcd0b6ff0f361 (diff)
downloadrtslib-fb-13ee44f02dc5c88253896792032f5e1c5fe4f885.tar.gz
Use to_normalized_wwn in _set_nexus
We can now use to_normalized_wwn, since it no longer checks against wwn_list. Signed-off-by: Andy Grover <agrover@redhat.com>
-rw-r--r--rtslib/target.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/rtslib/target.py b/rtslib/target.py
index ef193d1..515c824 100644
--- a/rtslib/target.py
+++ b/rtslib/target.py
@@ -267,17 +267,13 @@ class TPG(CFSNode):
if self._get_nexus():
raise RTSLibError("The TPG's nexus initiator WWN is already set.")
- # Nexus wwn type should match parent target
- wwn_type = self.parent_target.wwn_type
+ fm = self.parent_target.fabric_module
+
if nexus_wwn:
- # Not using fabric-specific version of normalize_wwn, since we
- # want to make sure wwn conforms to regexp, but don't check
- # against target wwn_list, since we're setting the "initiator" here.
- nexus_wwn = normalize_wwn((wwn_type,), nexus_wwn)[0]
+ nexus_wwn = fm.to_normalized_wwn(nexus_wwn)[0]
else:
- nexus_wwn = generate_wwn(wwn_type)
-
- fm = self.parent_target.fabric_module
+ # Nexus wwn type should match parent target
+ nexus_wwn = generate_wwn(self.parent_target.wwn_type)
fwrite("%s/nexus" % self.path, fm.to_fabric_wwn(nexus_wwn))