Skip to content

Commit 6e13dcb

Browse files
committed
CA-398425: correctly check for multiple targets in iSCSI
Signed-off-by: Mark Syms <[email protected]>
1 parent 0837303 commit 6e13dcb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/LVHDoISCSISR.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ def create_iscsi_sessions(self, sr_uuid):
103103
self.iscsiSRs = []
104104
self.iscsiSRs.append(iscsi)
105105
saved_exc = None
106-
if self.dconf['target'].find(',') == 0 or self.dconf['targetIQN'] == "*":
106+
targets = self.dconf['target'].split(',')
107+
if len(targets) > 1 or self.dconf['targetIQN'] == "*":
107108
# Instantiate multiple sessions
108109
self.iscsiSRs = []
109110
if self.dconf['targetIQN'] == "*":
@@ -129,7 +130,7 @@ def create_iscsi_sessions(self, sr_uuid):
129130
# IQNstring cannot be built with a dictionary iteration because of this
130131
IQNstring = self.dconf['multiSession']
131132
else:
132-
for tgt in self.dconf['target'].split(','):
133+
for tgt in targets:
133134
try:
134135
tgt_ip = util._convertDNS(tgt)
135136
except:

0 commit comments

Comments
 (0)