From 09b1f1f77cdec025f8f92f7395a38f76a11a0d85 Mon Sep 17 00:00:00 2001 From: Lorenz Leutgeb Date: Wed, 20 May 2026 09:33:38 +0200 Subject: [PATCH] node: Fix handling absence of systemd credential In case `radicle_systemd::credential::path` returns `Ok(None)`, a misleading warning is logged. Handle this case separately and do not emit a warning. --- crates/radicle-node/src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/radicle-node/src/main.rs b/crates/radicle-node/src/main.rs index 079546da..fb87335f 100644 --- a/crates/radicle-node/src/main.rs +++ b/crates/radicle-node/src/main.rs @@ -241,10 +241,14 @@ fn load_credential(id_suffix: &str) -> Option { let id_xyz = format!("{}{}{}", PREFIX_XYZ, INFIX_NODE, id_suffix); match radicle_systemd::credential::path(&id_xyz) { - Ok(option) => { + Ok(option @ Some(_)) => { log::warn!(target: "node", "Obtained path of the systemd credential with ID '{id_xyz}'. Using this credential ID is discouraged. Please change the ID to '{id_dev}'."); option } + Ok(None) => { + // No credential found with either ID. + None + } Err(err) => { log::warn!(target: "node", "Failed to obtain path of the systemd credential with ID '{id_xyz}': {err}"); None