diff --git a/src/lib/network/clients/save_network.rb b/src/lib/network/clients/save_network.rb index 01c5d2551..7df92e02b 100644 --- a/src/lib/network/clients/save_network.rb +++ b/src/lib/network/clients/save_network.rb @@ -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( diff --git a/test/save_network_test.rb b/test/save_network_test.rb index 8d20f8263..5bd0cee26 100644 --- a/test/save_network_test.rb +++ b/test/save_network_test.rb @@ -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 @@ -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