Skip to content

Commit

Permalink
Force a read of ifaces in case of autoLogon
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Nov 5, 2024
1 parent 22fe2d3 commit 1b802cd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/clients/inst_iscsi-client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 6 additions & 4 deletions src/modules/IscsiClientLib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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") || []
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1b802cd

Please sign in to comment.