diff --git a/rust/agama-manager/src/actions.rs b/rust/agama-manager/src/actions.rs index be01f33b56..049591b13b 100644 --- a/rust/agama-manager/src/actions.rs +++ b/rust/agama-manager/src/actions.rs @@ -294,12 +294,9 @@ impl SetConfigAction { .await?; } - if let Some(network) = config.network.clone() { - self.progress - .call(progress::message::Next::new(Scope::Manager)) - .await?; - self.network.update_config(network).await?; - self.network.apply().await?; + // FIXME: report the error in a proper way. + if let Err(error) = self.set_network(&config).await { + tracing::error!("Failed to set up the network: {error}"); } match &product { @@ -345,6 +342,20 @@ impl SetConfigAction { Ok(()) } + + async fn set_network(&self, config: &Config) -> Result<(), service::Error> { + let Some(network) = config.network.clone() else { + return Ok(()); + }; + + self.progress + .call(progress::message::Next::new(Scope::Manager)) + .await?; + self.network.update_config(network).await?; + self.network.apply().await?; + + Ok(()) + } } /// Implements the finish action. diff --git a/rust/agama-manager/src/service.rs b/rust/agama-manager/src/service.rs index 69e6acbc72..a302e85583 100644 --- a/rust/agama-manager/src/service.rs +++ b/rust/agama-manager/src/service.rs @@ -730,7 +730,6 @@ impl MessageHandler for Service { /// Sets the user configuration with the given values. async fn handle(&mut self, message: message::SetConfig) -> Result<(), Error> { checks::check_stage(&self.progress, Stage::Configuring).await?; - tracing::debug!("DEBUG: SetConfig handler (calling set_config)"); self.set_config(message.config).await } } diff --git a/rust/package/agama.changes b/rust/package/agama.changes index 6fcd2172fc..641bc1d853 100644 --- a/rust/package/agama.changes +++ b/rust/package/agama.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Mar 19 21:11:29 UTC 2026 - Imobach Gonzalez Sosa + +- Continue loading the configuration even if there is a network setup + error (gh#agama-project/agama#3306). + ------------------------------------------------------------------- Wed Mar 18 22:29:10 UTC 2026 - Imobach Gonzalez Sosa diff --git a/service/Gemfile.lock b/service/Gemfile.lock index 3dfb4f3403..23ef6b976d 100755 --- a/service/Gemfile.lock +++ b/service/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - agama-yast (19.devel14.752a116e9) + agama-yast (19.devel25.2db95cd44) cfa (~> 1.0.2) cfa_grub2 (~> 2.0.0) cheetah (~> 1.0.0) diff --git a/service/lib/agama/autoyast/connections_reader.rb b/service/lib/agama/autoyast/connections_reader.rb index 0cf287bd4a..b6da058e0f 100755 --- a/service/lib/agama/autoyast/connections_reader.rb +++ b/service/lib/agama/autoyast/connections_reader.rb @@ -63,8 +63,11 @@ def ipv6? # @return [Hash] def read_connection(interface) conn = {} - conn["interface"] = interface.device unless interface.device.to_s.empty? - conn["id"] = interface.name if interface.name + if !interface.device.to_s.empty? + conn["interface"] = interface.device + conn["id"] = interface.device + end + conn["id"] = interface.name unless interface.name.to_s.empty? addresses = read_addresses(interface) method4, method6 = read_methods(interface) diff --git a/service/package/rubygem-agama-yast.changes b/service/package/rubygem-agama-yast.changes index 0454652507..cd53fb17c7 100644 --- a/service/package/rubygem-agama-yast.changes +++ b/service/package/rubygem-agama-yast.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Mar 19 21:12:15 UTC 2026 - Imobach Gonzalez Sosa + +- AutoYaST support: use the connection "device" as fallback for network + connections with no "name" (gh#agama-project/agama#3306). + ------------------------------------------------------------------- Wed Mar 18 23:44:14 UTC 2026 - Imobach Gonzalez Sosa diff --git a/service/test/agama/autoyast/connections_reader_test.rb b/service/test/agama/autoyast/connections_reader_test.rb index f08af237c2..12298c7e67 100644 --- a/service/test/agama/autoyast/connections_reader_test.rb +++ b/service/test/agama/autoyast/connections_reader_test.rb @@ -49,6 +49,32 @@ end end + context "when the connection has a \"device\"" do + let(:interfaces) do + [{ "device" => "eth1" }] + end + + it "uses the \"device\" as \"id\" and \"interface\"" do + connections = subject.read["connections"] + conn = connections.first + expect(conn["id"]).to eq("eth1") + expect(conn["interface"]).to eq("eth1") + end + end + + context "when the connection has a \"name\"" do + let(:interfaces) do + [{ "name" => "eth0" }] + end + + it "uses the \"name\" as \"id\"" do + connections = subject.read["connections"] + conn = connections.first + expect(conn["id"]).to eq("eth0") + expect(conn["interface"]).to be_nil + end + end + context "when bootproto is set to DHCP" do it "sets method4 to 'auto'" do connections = subject.read["connections"]