From 1b802cdc7625110f06b2d9ae65e7be2e4217763d Mon Sep 17 00:00:00 2001 From: Knut Anderssen Date: Tue, 5 Nov 2024 12:03:10 +0000 Subject: [PATCH] Force a read of ifaces in case of autoLogon --- src/clients/inst_iscsi-client.rb | 5 +++-- src/modules/IscsiClientLib.rb | 10 ++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/clients/inst_iscsi-client.rb b/src/clients/inst_iscsi-client.rb index 7825c52..d5ec036 100644 --- a/src/clients/inst_iscsi-client.rb +++ b/src/clients/inst_iscsi-client.rb @@ -69,12 +69,13 @@ def main ) # check initiator name, create if not exists IscsiClientLib.checkInitiatorName - - IscsiClientLib.getiBFT IscsiClientLib.LoadOffloadModules + IscsiClientLib.getiBFT # try auto login to target auto_login = IscsiClientLib.autoLogOn + # force a read of ifaces + IscsiClientLib.read_ifaces if auto_login # force a read of sessions in case of auto_login (bsc#1228084) IscsiClientLib.readSessions if auto_login diff --git a/src/modules/IscsiClientLib.rb b/src/modules/IscsiClientLib.rb index 4bfce57..097bfc1 100644 --- a/src/modules/IscsiClientLib.rb +++ b/src/modules/IscsiClientLib.rb @@ -1278,6 +1278,11 @@ def iface_value(content, field) content.find { |l| l.include? field }.to_s.gsub(/[[:space:]]/, "").split("=")[1] end + def read_ifaces + InitIfaceFile() + InitIface() + end + def InitIfaceFile @iface_file = {} files = SCR.Read(path(".target.dir"), "/etc/iscsi/ifaces") || [] @@ -1476,10 +1481,7 @@ def bring_up(card_names) end def InitOffloadValid - if @iface_file.nil? - InitIfaceFile() - InitIface() - end + read_ifaces if @iface_file.nil? @offload_valid = potential_offload_cards card_names = @offload_valid.values.flatten(1).map { |c| c["iface"] }.uniq