[pbs-devel] [PATCH proxmox-backup v2] fix #7242: client: warn on logout if no ticket is found
Arthur Bied-Charreton
a.bied-charreton at proxmox.com
Tue Jan 20 17:00:42 CET 2026
When running `proxmox-backup-client logout` on a repository that has no
stored credentials, emit a warning instead of silently succeeding.
This can help users identify typos without breaking scripts that may run
logout as a precautionary first step.
Signed-off-by: Arthur Bied-Charreton <a.bied-charreton at proxmox.com>
---
I was not sure about emitting warnings direcly in delete_ticket_info,
but after a look through the code this seems to be done similarly in
other places. Please let me know if I should follow a different pattern
for this kind of warning.
Changes since v1:
- Resent with correct From/Signed-off-by address (no code changes)
pbs-client/src/http_client.rs | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/pbs-client/src/http_client.rs b/pbs-client/src/http_client.rs
index af53f74e..4730db8d 100644
--- a/pbs-client/src/http_client.rs
+++ b/pbs-client/src/http_client.rs
@@ -237,7 +237,11 @@ pub fn delete_ticket_info(prefix: &str, server: &str, username: &Userid) -> Resu
let mut data = file_get_json(&path, Some(json!({})))?;
if let Some(map) = data[server].as_object_mut() {
- map.remove(username.as_str());
+ if map.remove(username.as_str()).is_none() {
+ warn!("no ticket found for {username} on server {server}");
+ }
+ } else {
+ warn!("no ticket found for server {server}");
}
replace_file(
--
2.47.3
More information about the pbs-devel
mailing list