]> git.proxmox.com Git - pve-network.git/commitdiff
status: warn only once about old or void SDN interfaces config
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 3 Jun 2020 11:19:26 +0000 (13:19 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 3 Jun 2020 11:19:26 +0000 (13:19 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/Network/SDN/Zones.pm

index c16bf942aff0678d52500ebabb8e2c292eec9439..4fd4a14e14e162e8fe57e7d9f8f806f7d6c3cef7 100644 (file)
@@ -177,6 +177,7 @@ sub ifquery_check {
     return $interfaces;
 }
 
+my $warned_about_reload;
 # improve me : move status code inside plugins ?
 sub status {
 
@@ -189,10 +190,18 @@ sub status {
 
     if (!$local_version) {
        $err_config = "local sdn network configuration is not yet generated, please reload";
-       warn "$err_config\n";
+       if (!$warned_about_reload) {
+           $warned_about_reload = 1;
+           warn "$err_config\n";
+       }
     } elsif ($local_version < $sdn_version) {
        $err_config = "local sdn network configuration is too old, please reload";
-       warn "$err_config\n";
+       if (!$warned_about_reload) {
+           $warned_about_reload = 1;
+           warn "$err_config\n";
+       }
+    } else {
+       $warned_about_reload = 0;
     }
 
     my $status = ifquery_check();