From db227840f18213324b0077d20debb3a454eab2d0 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Fri, 16 Apr 2021 15:57:36 -0400 Subject: [PATCH] daemon: Always write `staged` JSON field It's an important property, and it's more self-documenting if we always emit the value rather than only when it's `true`. --- rust/src/daemon.rs | 2 +- tests/kolainst/nondestructive/misc.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/rust/src/daemon.rs b/rust/src/daemon.rs index cdf01365..fb0b2c92 100644 --- a/rust/src/daemon.rs +++ b/rust/src/daemon.rs @@ -61,8 +61,8 @@ pub(crate) fn deployment_populate_variant( } /* Staging status */ + dict.insert("staged", &deployment.is_staged()); if deployment.is_staged() { - dict.insert("staged", &true); if std::path::Path::new("/run/ostree/staged-deployment-locked").exists() { dict.insert("finalization-locked", &true); } diff --git a/tests/kolainst/nondestructive/misc.sh b/tests/kolainst/nondestructive/misc.sh index 657c7528..71d9c96b 100755 --- a/tests/kolainst/nondestructive/misc.sh +++ b/tests/kolainst/nondestructive/misc.sh @@ -16,7 +16,8 @@ assert_jq status.json \ '.deployments[0]["requested-base-removals"]' \ '.deployments[0]["live-inprogress"]|not' \ '.deployments[0]["live-replaced"]|not' \ - '.deployments[0]["layered-commit-meta"]|not' + '.deployments[0]["layered-commit-meta"]|not' \ + '.deployments[0]["staged"]|not' rm status.json rpm-ostree testutils validate-parse-status echo "ok empty pkg arrays, and commit meta correct in status json"