public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Arthur Bied-Charreton <arthur@biedcharreton.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] SPAM: [PATCH proxmox-backup] fix #7242: client: warn on logout if no ticket is found
Date: Tue, 20 Jan 2026 16:43:54 +0100	[thread overview]
Message-ID: <20260120154549.154474-1-arthur@biedcharreton.com> (raw)

From: Arthur Bied-Charreton <a.bied-charreton@proxmox.com>

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 existing scripts.

Signed-off-by: Arthur Bied-Charreton <arthur@biedcharreton.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.

 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


_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


             reply	other threads:[~2026-01-20 15:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-20 15:43 Arthur Bied-Charreton [this message]
2026-01-20 16:17 ` [pbs-devel] " Arthur Bied-Charreton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260120154549.154474-1-arthur@biedcharreton.com \
    --to=arthur@biedcharreton.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal