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/plugin: do not test connection if disabled
Date: Mon,  7 Dec 2020 15:37:07 +0100	[thread overview]
Message-ID: <20201207143707.18456-1-d.csapak@proxmox.com> (raw)

so that if one disables the plugin (e.g. because it is offline),
it will work even when the server is not reachable

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
if my other series is ok, i'll rebase either this, or my other
series, depending what gets applied first ;)

 PVE/Status/Plugin.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/PVE/Status/Plugin.pm b/PVE/Status/Plugin.pm
index c3e0bec1..040b4538 100644
--- a/PVE/Status/Plugin.pm
+++ b/PVE/Status/Plugin.pm
@@ -129,6 +129,9 @@ sub send {
 sub test_connection {
     my ($class, $cfg) = @_;
 
+    # do not check connection for disabled plugins
+    return if $cfg->{disable};
+
     my $conn = $class->_connect($cfg);
     $class->_disconnect($conn);
 }
-- 
2.20.1





             reply	other threads:[~2020-12-07 14:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-07 14:37 Dominik Csapak [this message]
2020-12-07 16:21 ` [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=20201207143707.18456-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