Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix root filesystem check for adjusting ifcfg config files #633

Merged
merged 2 commits into from
May 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions package/yast2-network.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
-------------------------------------------------------------------
Wed May 9 10:35:36 UTC 2018 - knut.anderssen@suse.com

- Fix the check for adjusting ifcfg configuration in case of
network based root filesystem when saving the network at the end
of the installation (bsc#1090752).
- 4.0.31

-------------------------------------------------------------------
Wed Apr 25 08:31:35 UTC 2018 - knut.anderssen@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.0.30
Version: 4.0.31
Release: 0
BuildArch: noarch

Expand Down
8 changes: 3 additions & 5 deletions src/lib/network/clients/save_network.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,14 @@ def adjust_for_network_disks(file)
# storage-ng
# Check if installation is targeted to a remote destination.
devicegraph = Y2Storage::StorageManager.instance.staging
is_disk_in_network = devicegraph.filesystem_in_network?(
Installation.destdir
)
is_disk_in_network = devicegraph.filesystem_in_network?("/")

if !is_disk_in_network
log.info("Directory \"#{Installation.destdir}\" is not on a network based device")
log.info("Root filesystem is not on a network based device")
return
end

log.info("Directory \"#{Installation.destdir}\" is on a network based device")
log.info("Root filesystem is on a network based device")

# tune ifcfg file for remote filesystem
SCR.Execute(
Expand Down
6 changes: 3 additions & 3 deletions test/save_network_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
Y2Storage::StorageManager.create_test_instance

staging = Y2Storage::StorageManager.instance.staging
allow(staging).to receive(:filesystem_in_network?).and_return(in_network)
allow(staging).to receive(:filesystem_in_network?).with("/").and_return(in_network)
allow(subject).to receive(:save_network)
# Mainly for import
subject.main
end

context "when installation directory is in a network device" do
context "when the root filesystem of the target system is in a network device" do
let(:in_network) { true }

it "tunes ifcfg file for remote filesystem" do
Expand All @@ -38,7 +38,7 @@
end
end

context "when installation directory is in a local device" do
context "when the root filesystem of the target system is in a local device" do
let(:in_network) { false }

it "does not touch any configuration file" do
Expand Down