[PATCH 19/24] Eliminate useless conditional

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"if not self" should never be true, and this the is_valid_wwn check
was never taking place.

Signed-off-by: Andy Grover <agrover@xxxxxxxxxx>
---
 rtslib/target.py |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/rtslib/target.py b/rtslib/target.py
index e751447..e577c39 100644
--- a/rtslib/target.py
+++ b/rtslib/target.py
@@ -1305,10 +1305,9 @@ class Target(CFSNode):
 
         self.wwn = wwn
         self._path = "%s/%s" % (self.fabric_module.path, self.wwn)
-        if not self:
-            if not self.fabric_module.is_valid_wwn(self.wwn):
-                raise RTSLibError("Invalid %s wwn: %s"
-                                  % (self.wwn_type, self.wwn))
+        if not self.fabric_module.is_valid_wwn(self.wwn):
+            raise RTSLibError("Invalid %s wwn: %s"
+                              % (self.wwn_type, self.wwn))
         self._create_in_cfs_ine(mode)
 
     def _list_tpgs(self):
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux