Skip to content
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
23 changes: 17 additions & 6 deletions rust/agama-manager/src/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion rust/agama-manager/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,6 @@ impl MessageHandler<message::SetConfig> 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
}
}
Expand Down
6 changes: 6 additions & 0 deletions rust/package/agama.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Mar 19 21:11:29 UTC 2026 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

- 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 <igonzalezsosa@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion service/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
7 changes: 5 additions & 2 deletions service/lib/agama/autoyast/connections_reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions service/package/rubygem-agama-yast.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Mar 19 21:12:15 UTC 2026 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

- 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 <igonzalezsosa@suse.com>

Expand Down
26 changes: 26 additions & 0 deletions service/test/agama/autoyast/connections_reader_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
Loading