public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager] status: influxdb: suppress warning when no token exists
Date: Mon, 20 Dec 2021 13:43:10 +0100	[thread overview]
Message-ID: <20211220124310.3943121-1-d.csapak@proxmox.com> (raw)

in get_credentials, we try to read the token for the specified server,
and warn if we cannot do that (e.g. because the file does not exist)

since having no token is a valid configuration, suppress that warning on
connection.

reported by a forum-user:
https://forum.proxmox.com/threads/interface-comes-up-with-all-question-marks.83287/page-2#post-438204

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
alternatively, we could create an empty file on creation, but this does
not fix existing installations.

 PVE/Status/InfluxDB.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/Status/InfluxDB.pm b/PVE/Status/InfluxDB.pm
index cb788c4e..def7e2fd 100644
--- a/PVE/Status/InfluxDB.pm
+++ b/PVE/Status/InfluxDB.pm
@@ -225,7 +225,7 @@ sub _connect {
 
 	return $socket;
     } elsif ($proto =~ m/^https?$/) {
-	my $token = get_credentials($id);
+	my $token = get_credentials($id, 1);
 	my $org = $cfg->{organization} // 'proxmox';
 	my $bucket = $cfg->{bucket} // 'proxmox';
 	my $url = _get_v2url($cfg, "write?org=${org}&bucket=${bucket}");
-- 
2.30.2





             reply	other threads:[~2021-12-20 12:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-20 12:43 Dominik Csapak [this message]
2021-12-21 14:45 ` [pve-devel] applied: " Thomas Lamprecht

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=20211220124310.3943121-1-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pve-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