From 3affb7c21df5cd9e129311edcb3a6dd5226f5681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Imobach=20Gonz=C3=A1lez=20Sosa?= Date: Fri, 6 Feb 2026 13:58:28 +0000 Subject: [PATCH 1/2] Fix parsing of the answers file --- rust/Cargo.lock | 1 + rust/agama-cli/Cargo.toml | 1 + rust/agama-cli/src/questions.rs | 11 +++++++++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 8020865382..18274b70b2 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -61,6 +61,7 @@ dependencies = [ "inquire", "regex", "reqwest", + "serde", "serde_json", "tempfile", "thiserror 2.0.18", diff --git a/rust/agama-cli/Cargo.toml b/rust/agama-cli/Cargo.toml index 4b1d87b9cc..814542d7c0 100644 --- a/rust/agama-cli/Cargo.toml +++ b/rust/agama-cli/Cargo.toml @@ -28,6 +28,7 @@ chrono = "0.4.38" regex = "1.11.1" home = "0.5.11" fluent-uri = "0.3.2" +serde = { version = "1.0.228", features = ["derive"] } [[bin]] name = "agama" diff --git a/rust/agama-cli/src/questions.rs b/rust/agama-cli/src/questions.rs index f15f018b42..311c3b2f3f 100644 --- a/rust/agama-cli/src/questions.rs +++ b/rust/agama-cli/src/questions.rs @@ -24,6 +24,7 @@ use agama_lib::{http::BaseHTTPClient, questions::http_client::HTTPClient}; use agama_utils::api::question::{AnswerRule, Policy, QuestionSpec}; use anyhow::anyhow; use clap::{Args, Subcommand, ValueEnum}; +use serde::Deserialize; // TODO: use for answers also JSON to be consistent #[derive(Subcommand, Debug)] @@ -72,11 +73,17 @@ async fn set_mode(client: HTTPClient, value: Modes) -> anyhow::Result<()> { Ok(()) } +#[derive(Deserialize)] +struct AnswersWrapper { + #[serde(default)] + answers: Vec, +} + async fn set_answers(client: HTTPClient, path: &str) -> anyhow::Result<()> { let file = File::open(&path)?; let reader = BufReader::new(file); - let rules: Vec = serde_json::from_reader(reader)?; - client.set_answers(rules).await?; + let wrapper: AnswersWrapper = serde_json::from_reader(reader)?; + client.set_answers(wrapper.answers).await?; Ok(()) } From c87e0f2939ae0407d7519aa559eb7162c337b022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Imobach=20Gonz=C3=A1lez=20Sosa?= Date: Fri, 6 Feb 2026 14:00:16 +0000 Subject: [PATCH 2/2] Update changes file --- rust/package/agama.changes | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rust/package/agama.changes b/rust/package/agama.changes index 0e6bc11c70..a2cbc7cc00 100644 --- a/rust/package/agama.changes +++ b/rust/package/agama.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Feb 6 13:59:11 UTC 2026 - Imobach Gonzalez Sosa + +- Fix parsing of the answers file (bsc#1257400). + ------------------------------------------------------------------- Fri Feb 6 07:38:38 UTC 2026 - Imobach Gonzalez Sosa @@ -52,7 +57,7 @@ Fri Jan 30 11:00:08 UTC 2026 - Knut Anderssen Thu Jan 29 22:30:05 UTC 2026 - Imobach Gonzalez Sosa - Do not export neither network/connections nor network/state when - they are None (related to bsc#1257400). + they are None (related to bsc#1257230). ------------------------------------------------------------------- Thu Jan 29 21:10:18 UTC 2026 - Josef Reidinger