From: Fiona Ebner <f.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup] http client: suppress "storing login ticket"-error when not using a TTY
Date: Thu, 5 Jan 2023 11:19:32 +0100 [thread overview]
Message-ID: <20230105101932.42852-1-f.ebner@proxmox.com> (raw)
as a stop-gap measure. Otherwise, task logs for PVE backups started
via non-CLI will have the message
> storing login ticket failed: $XDG_RUNTIME_DIR must be set
show up when running a proxmox-backup-client command (e.g. setting
notes and when uploading the log). This is confusing to users[0].
[0]: https://forum.proxmox.com/threads/120492/
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
pbs-client/src/http_client.rs | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/pbs-client/src/http_client.rs b/pbs-client/src/http_client.rs
index 1317517f..d9f6b7af 100644
--- a/pbs-client/src/http_client.rs
+++ b/pbs-client/src/http_client.rs
@@ -458,7 +458,9 @@ impl HttpClient {
&auth.ticket,
&auth.token,
) {
- log::error!("storing login ticket failed: {}", err);
+ if tty::stdout_isatty() {
+ log::error!("storing login ticket failed: {}", err);
+ }
}
}
*auth2.write().unwrap() = auth;
@@ -494,7 +496,9 @@ impl HttpClient {
&auth.ticket,
&auth.token,
) {
- log::error!("storing login ticket failed: {}", err);
+ if tty::stdout_isatty() {
+ log::error!("storing login ticket failed: {}", err);
+ }
}
}
*authinfo.write().unwrap() = auth;
--
2.30.2
next reply other threads:[~2023-01-05 10:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-05 10:19 Fiona Ebner [this message]
2023-01-05 11:30 ` [pbs-devel] applied: " Wolfgang Bumiller
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=20230105101932.42852-1-f.ebner@proxmox.com \
--to=f.ebner@proxmox.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.