From ef8d35c862e78ff55e08f9af6668f8fc4c7ca484 Mon Sep 17 00:00:00 2001 From: Alexandre Derumier Date: Tue, 4 Jun 2019 07:03:41 +0200 Subject: [PATCH] generateconfig: use uplink$id if interface don't exist don't die, generate config, and we'll check error with ifquery as interface don't exist Signed-off-by: Alexandre Derumier --- PVE/Network/Network/VlanPlugin.pm | 3 +-- PVE/Network/Network/VxlanMulticastPlugin.pm | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/PVE/Network/Network/VlanPlugin.pm b/PVE/Network/Network/VlanPlugin.pm index affa274..f0119e4 100644 --- a/PVE/Network/Network/VlanPlugin.pm +++ b/PVE/Network/Network/VlanPlugin.pm @@ -68,7 +68,6 @@ sub generate_network_config { my $vlanallowed = $plugin_config->{'vlan-allowed'}; die "missing vlan tag" if !$tag; - die "uplink $uplink is not defined" if !$uplinks->{$uplink}; eval { PVE::Network::Network::Plugin::parse_tag_number_or_range($vlanallowed, '4096', $tag) if $vlanallowed; @@ -77,7 +76,7 @@ sub generate_network_config { die "vlan $tag is not allowed in transport $zoneid"; } - my $iface = $uplinks->{$uplink}; + my $iface = $uplinks->{$uplink} ? $uplinks->{$uplink} : "uplink$uplink"; $iface .= ".$tag"; my $config = "\n"; diff --git a/PVE/Network/Network/VxlanMulticastPlugin.pm b/PVE/Network/Network/VxlanMulticastPlugin.pm index 16dc593..7898f79 100644 --- a/PVE/Network/Network/VxlanMulticastPlugin.pm +++ b/PVE/Network/Network/VxlanMulticastPlugin.pm @@ -54,8 +54,7 @@ sub generate_network_config { my $vxlanallowed = $plugin_config->{'vxlan-allowed'}; die "missing vxlan tag" if !$tag; - die "uplink $uplink is not defined" if !$uplinks->{$uplink}; - my $iface = $uplinks->{$uplink}; + my $iface = $uplinks->{$uplink} ? $uplinks->{$uplink} : "uplink$uplink"; eval { PVE::Network::Network::Plugin::parse_tag_number_or_range($vxlanallowed, '16777216', $tag) if $vxlanallowed; -- 2.39.5