From 521c44ad891ecb5ddbe99dfbab0e3ca0beb6f954 Mon Sep 17 00:00:00 2001 From: Mark Syms Date: Fri, 30 Aug 2024 10:13:27 +0100 Subject: [PATCH] CA-398425: correctly check for multiple targets in iSCSI Signed-off-by: Mark Syms --- drivers/LVHDoISCSISR.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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: