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
1 change: 1 addition & 0 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions rust/agama-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
11 changes: 9 additions & 2 deletions rust/agama-cli/src/questions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -72,11 +73,17 @@ async fn set_mode(client: HTTPClient, value: Modes) -> anyhow::Result<()> {
Ok(())
}

#[derive(Deserialize)]
struct AnswersWrapper {
#[serde(default)]
answers: Vec<AnswerRule>,
}

async fn set_answers(client: HTTPClient, path: &str) -> anyhow::Result<()> {
let file = File::open(&path)?;
let reader = BufReader::new(file);
let rules: Vec<AnswerRule> = 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(())
}

Expand Down
7 changes: 6 additions & 1 deletion rust/package/agama.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Feb 6 13:59:11 UTC 2026 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

- Fix parsing of the answers file (bsc#1257400).

-------------------------------------------------------------------
Fri Feb 6 07:38:38 UTC 2026 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

Expand Down Expand Up @@ -52,7 +57,7 @@ Fri Jan 30 11:00:08 UTC 2026 - Knut Anderssen <kanderssen@suse.com>
Thu Jan 29 22:30:05 UTC 2026 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

- 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 <jreidinger@suse.com>
Expand Down
Loading