From 263dfbda4ac145afc8c6ff6d3d7655e0d15e5714 Mon Sep 17 00:00:00 2001 From: navigator Date: Fri, 2 Oct 2026 03:48:39 +0000 Subject: [PATCH] fix: Database mode and network confirm screens say only what is true Database mode on a machine with no database server no longer appends keel inspect's stderr, which is about other fields (a missing fqdn in the maintainer's screenshot 045). The verdict of a refused keel network confirm (exit 21) no longer claims the change reverts when its window ends: keel refuses for several reasons, nothing waiting among them, as when another session confirmed it already (screenshot 040); it now points at keel's own line. --- dbscreen.py | 6 ++++-- debian/changelog | 17 +++++++++++++++++ keelcli.py | 6 ++++-- tests/test_database_mode.py | 16 ++++++++++++++++ tests/test_overlay_screen.py | 13 +++++++++++++ 5 files changed, 54 insertions(+), 4 deletions(-) diff --git a/dbscreen.py b/dbscreen.py index 8e4f743..095017a 100644 --- a/dbscreen.py +++ b/dbscreen.py @@ -102,12 +102,14 @@ def engine_of(console, title: str, server: dict) -> str: declared = str(server.get("engine") or "") if declared: return declared - observed, output, problem = observed_engine() + observed, _, problem = observed_engine() if problem: console.msgbox(title, problem) return "" if not observed: - console.msgbox(title, f"{NO_ENGINE}\n\n{output}".strip()) + # inspect wrote its spec, so what it printed is about other + # fields (a missing fqdn, say), not about the database server + console.msgbox(title, NO_ENGINE) return observed diff --git a/debian/changelog b/debian/changelog index 1f76429..41dc66d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,20 @@ +confconsole (2.2.3+keel10) trixie; urgency=low + + * Database mode on a machine with no database server says only that: + the screen appended what keel inspect printed on stderr, which is about + other fields, so a Core that had no fully qualified name showed + "Error: inspect: required fields not inferred: instance.fqdn" under + the no-server text (the maintainer's screenshot 045). + * The verdict of a refused keel network confirm (exit 21) no longer says + the change reverts when its window ends: keel refuses for several + reasons, nothing waiting among them, as when another session had + confirmed the change already (screenshot 040). It now reads "not + confirmed: the reason is above", and keel's own line says which. + * Numbered keel10 because pull request #16 (the console art) takes + keel9. + + -- Marcos Méndez Fri, 02 Oct 2026 06:00:00 +0000 + confconsole (2.2.3+keel8) trixie; urgency=low * keelfirstboot.py, the first boot screens handbook decision 0020 diff --git a/keelcli.py b/keelcli.py index bd1ce44..4909421 100644 --- a/keelcli.py +++ b/keelcli.py @@ -68,8 +68,10 @@ }, "confirm": { OK: "confirmed: the network change stays", - NETWORK_NOT_CONFIRMED: "not confirmed: the change reverts when its" - " window ends unless a new session confirms it", + # keel refuses for several reasons, nothing waiting among them + # (another session may have confirmed it already), so the verdict + # repeats none of them and points at keel's own line + NETWORK_NOT_CONFIRMED: "not confirmed: the reason is above", }, "key": { OK: "this node's public key; the private key never leaves the" diff --git a/tests/test_database_mode.py b/tests/test_database_mode.py index 430cd81..0bf6cca 100644 --- a/tests/test_database_mode.py +++ b/tests/test_database_mode.py @@ -507,6 +507,22 @@ def test_a_machine_running_no_database_server_has_no_mode( assert dbscreen.engine_of(console, "x", {}) == "" assert "No database server was found" in console.calls[-1][2] + def test_what_inspect_could_not_infer_elsewhere_is_not_shown( + self, keel, tmp_path, monkeypatch + ): + """The maintainer's screenshot 045: inspect wrote its spec, which + names no server, and said on stderr that another field (the fqdn) + was not inferred; that is not why there is no mode to choose""" + inspected = tmp_path / "inspected.yaml" + inspected.write_text(yaml.safe_dump({"version": 1})) + monkeypatch.setattr(dbscreen, "INSPECTED", str(inspected)) + keel["answers"] = [(13, "", "Error: inspect: required fields not" + " inferred: instance.fqdn\n")] + console = FakeConsole() + + assert dbscreen.engine_of(console, "x", {}) == "" + assert console.calls[-1][2] == dbscreen.NO_ENGINE + def test_an_inspection_that_cannot_be_read_says_so( self, keel, tmp_path, monkeypatch ): diff --git a/tests/test_overlay_screen.py b/tests/test_overlay_screen.py index c9a1fd7..30ea53f 100644 --- a/tests/test_overlay_screen.py +++ b/tests/test_overlay_screen.py @@ -235,6 +235,19 @@ def test_the_confirm_and_key_verdicts(self): "confirm", make_result(wgcli.CONFIRM, 0)) assert "not confirmed" in wgcli.command_text( "confirm", make_result(wgcli.CONFIRM, 21)) + + def test_nothing_waiting_is_not_called_a_change_that_reverts(self): + """The maintainer's screenshot 040: another session had confirmed + the change, and the screen said it would revert. keel says why it + refused; the verdict line claims nothing keel did not say.""" + nothing = make_result( + wgcli.CONFIRM, 21, "", "Error: no network change is waiting for" + " a confirmation; the last one, of /etc/wireguard/wg0.conf, was" + " reverted\n") + text = wgcli.command_text("confirm", nothing) + assert "not confirmed" in text + assert "reverts when" not in text + assert "the reason is above" in text assert "no public key" in wgcli.command_text( "key", make_result(wgcli.KEY, 16))