]> git.proxmox.com Git - pve-manager.git/commitdiff
status: influxdb: suppress warning when no token exists
authorDominik Csapak <d.csapak@proxmox.com>
Mon, 20 Dec 2021 12:43:10 +0000 (13:43 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 21 Dec 2021 14:44:38 +0000 (15:44 +0100)
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>
PVE/Status/InfluxDB.pm

index cb788c4e5d0f7f85de619149f8277bd5fd6808bf..def7e2fd90828e1cc4474fa74d72dd0acf02a392 100644 (file)
@@ -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}");