if vnet has not been generated (this should never happend)
warn the user to check if "source /etc/network/interfaces.d/sdn'
exist

Signed-off-by: Alexandre Derumier <aderum...@odiso.com>
---
 src/PVE/Network/SDN/Zones.pm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/PVE/Network/SDN/Zones.pm b/src/PVE/Network/SDN/Zones.pm
index 7d70e49..e26e21f 100644
--- a/src/PVE/Network/SDN/Zones.pm
+++ b/src/PVE/Network/SDN/Zones.pm
@@ -267,7 +267,11 @@ sub status {
        my $err_msg = $plugin->status($plugin_config, $zone, $id, $vnet, 
$status);
        if (@{$err_msg} > 0) {
            $vnet_status->{$id}->{status} = 'error';
-           $vnet_status->{$id}->{statusmsg} = join(',', @{$err_msg});
+           if (grep(/^missing ${id}$/, @$err_msg)) {
+               $vnet_status->{$id}->{statusmsg} = "vnet $id is not generated. 
Do you have included 'source /etc/network/interfaces.d/sdn' ?";
+           } else {
+               $vnet_status->{$id}->{statusmsg} = join(',', @{$err_msg});
+           }
            $zone_status->{$zone}->{status} = 'error';
        }
     }
-- 
2.30.2


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to