Skip to content

Commit

Permalink
Some rubocop fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Oct 31, 2024
1 parent 161356d commit c4747fc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
6 changes: 1 addition & 5 deletions src/modules/IscsiClientLib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1221,17 +1221,13 @@ def autoyastWrite
ifacepar << " " unless ifacepar.empty?
ifacepar << "-I " << iface.shellescape
ifaces << iface
end

@ay_settings.fetch("targets", []).each do |target|
next if portals.include? target["portal"]
SCR.Execute(
path(".target.bash"),
GetAdmCmd(%(-m discovery #{ifacepar} -t st -p #{target["portal"].shellescape}))
)
portals << target["portal"]
end
@ay_settings.fetch("targets", []).each do |target|
log.info "login into target #{target}"
loginIntoTarget(target)
@currentRecord = [target["portal"], target["target"], target["iface"]]
Expand Down Expand Up @@ -1298,7 +1294,7 @@ def InitIfaceFile
files.each do |file|
ls = SCR.Read(path(".target.string"), "/etc/iscsi/ifaces/#{file}").split("\n")
log.info "InitIfaceFile file: #{file}\nInitIfaceFile ls: #{ls}"
ls.select! { |l| !l.start_with?(/\s*#/) }
ls.reject! { |l| l.start_with?(/\s*#/) }
iface_name = ls.find { |l| l.include? "iface.iscsi_ifacename" }.to_s
log.info "InitIfaceFile ls: #{iface_name}"
next if iface_name.empty?
Expand Down
16 changes: 8 additions & 8 deletions test/iscsi_client_lib_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -914,16 +914,16 @@ def ui_item_label(item)
include_examples "returns UI items"

it "includes 'default', 'all' and an entry for each offload card" do
items = subject.iface_items
items = subject.iface_items

labels = items.map { |i| ui_item_label(i) }
expect(labels).to contain_exactly(
"default (Software)", "all", "bnx2i.ab:cd:de:fa:cf:29.ipv4.0 - 192.168.100.29"
)
labels = items.map { |i| ui_item_label(i) }
expect(labels).to contain_exactly(
"default (Software)", "all", "bnx2i.ab:cd:de:fa:cf:29.ipv4.0 - 192.168.100.29"
)

ids = items.map { |i| ui_item_id(i) }
expect(ids).to contain_exactly("default", "all", "bnx2i.ab:cd:de:fa:cf:29.ipv4.0")
end
ids = items.map { |i| ui_item_id(i) }
expect(ids).to contain_exactly("default", "all", "bnx2i.ab:cd:de:fa:cf:29.ipv4.0")
end
end

context "and no iscsi iface is reported by iscsiadm " do
Expand Down

0 comments on commit c4747fc

Please sign in to comment.