From eb670f1908de032476ef19e4fd3d76a86993b4f7 Mon Sep 17 00:00:00 2001 From: Maurizio Lombardi Date: Mon, 2 Oct 2023 12:13:35 +0200 Subject: [PATCH] remove a reference to MAX_LUN which has been removed from rtslib Signed-off-by: Maurizio Lombardi --- targetcli/ui_target.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/targetcli/ui_target.py b/targetcli/ui_target.py index e8ba6c6a383e..2c46765f9d1a 100644 --- a/targetcli/ui_target.py +++ b/targetcli/ui_target.py @@ -1146,16 +1146,11 @@ class UILUNs(UINode): mapped_lun = 0 existing_mluns = [mlun.mapped_lun for mlun in acl.mapped_luns] if mapped_lun in existing_mluns: - mapped_lun = None - for possible_mlun in six.moves.range(MappedLUN.MAX_LUN): - if possible_mlun not in existing_mluns: - mapped_lun = possible_mlun - break - - if mapped_lun == None: - self.shell.log.warning( - "Cannot map new lun %s into ACL %s" - % (lun_object.lun, acl.node_wwn)) + possible_mlun = 0 + while possible_mlun in existing_mluns: + possible_mlun += 1 + mapped_lun = possible_mlun + else: mlun = MappedLUN(acl, mapped_lun, lun_object, write_protect=False) self.shell.log.info("Created LUN %d->%d mapping in node ACL %s" -- 2.39.3