diff --git a/drivers/LVHDoISCSISR.py b/drivers/LVHDoISCSISR.py index cbde1b92..442ec30f 100755 --- a/drivers/LVHDoISCSISR.py +++ b/drivers/LVHDoISCSISR.py @@ -103,7 +103,8 @@ def create_iscsi_sessions(self, sr_uuid): self.iscsiSRs = [] self.iscsiSRs.append(iscsi) saved_exc = None - if self.dconf['target'].find(',') == 0 or self.dconf['targetIQN'] == "*": + targets = self.dconf['target'].split(',') + if len(targets) > 1 or self.dconf['targetIQN'] == "*": # Instantiate multiple sessions self.iscsiSRs = [] if self.dconf['targetIQN'] == "*": @@ -129,7 +130,7 @@ def create_iscsi_sessions(self, sr_uuid): # IQNstring cannot be built with a dictionary iteration because of this IQNstring = self.dconf['multiSession'] else: - for tgt in self.dconf['target'].split(','): + for tgt in targets: try: tgt_ip = util._convertDNS(tgt) except: