Skip to content

Commit

Permalink
Merge pull request #1159 from yast/really_memoize_hardware
Browse files Browse the repository at this point in the history
Cache the netcards 'hwinfo' speeding up the access to it (bsc#1180702)
  • Loading branch information
teclator committed Feb 4, 2021
2 parents 6c47fe6 + 45243d5 commit 267cb63
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions package/yast2-network.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Feb 4 15:05:25 UTC 2021 - Knut Anderssen <kanderssen@suse.com>

- Cache the hardware netcards information in order to speed up the
access (bsc#1180702)
- 4.3.44

-------------------------------------------------------------------
Mon Feb 1 20:05:05 UTC 2021 - Knut Anderssen <kanderssen@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-network.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-network
Version: 4.3.43
Version: 4.3.44
Release: 0
Summary: YaST2 - Network Configuration
License: GPL-2.0-only
Expand Down
2 changes: 2 additions & 0 deletions src/lib/y2network/hwinfo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ def hwinfo_from_hardware(name)
#
# @return [HardWrapper]
def hardware_wrapper
return @hardware_wrapper if @hardware_wrapper

@hardware_wrapper = HardwareWrapper.new
end

Expand Down
1 change: 1 addition & 0 deletions src/lib/y2network/wicked/interfaces_reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class InterfacesReader
def config
return @config if @config

Hwinfo.reset
find_s390_devices
find_physical_interfaces
find_connections
Expand Down
1 change: 1 addition & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@

c.before do
Yast::Lan.clear_configs
Y2Network::Hwinfo.reset
allow(Yast::NetworkInterfaces).to receive(:Write)
allow(Y2Network::Hwinfo).to receive(:hwinfo_from_hardware)
Y2Storage::StorageManager.create_test_instance
Expand Down

0 comments on commit 267cb63

Please sign in to comment.