[pve-devel] [PATCH manager] status/plugin: do not test connection if disabled

Dominik Csapak d.csapak at proxmox.com
Mon Dec 7 15:37:07 CET 2020


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 at 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






More information about the pve-devel mailing list