[pve-devel] [PATCH pve-network] use PVE::Tools::split_list for ip lists

Alexandre Derumier aderumier at odiso.com
Tue Jun 30 14:25:29 CEST 2020


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/Network/SDN/Controllers/EvpnPlugin.pm | 4 ++--
 PVE/Network/SDN/Zones/EvpnPlugin.pm       | 2 +-
 PVE/Network/SDN/Zones/VxlanPlugin.pm      | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/PVE/Network/SDN/Controllers/EvpnPlugin.pm b/PVE/Network/SDN/Controllers/EvpnPlugin.pm
index 79ecaeb..9321af1 100644
--- a/PVE/Network/SDN/Controllers/EvpnPlugin.pm
+++ b/PVE/Network/SDN/Controllers/EvpnPlugin.pm
@@ -47,11 +47,11 @@ sub options {
 sub generate_controller_config {
     my ($class, $plugin_config, $controller, $id, $uplinks, $config) = @_;
 
-    my @peers = split(',', $plugin_config->{'peers'}) if $plugin_config->{'peers'};
+    my @peers = PVE::Tools::split_list($plugin_config->{'peers'}) if $plugin_config->{'peers'};
 
     my $asn = $plugin_config->{asn};
     my $gatewaynodes = $plugin_config->{'gateway-nodes'};
-    my @gatewaypeers = split(',', $plugin_config->{'gateway-external-peers'}) if $plugin_config->{'gateway-external-peers'};
+    my @gatewaypeers = PVE::Tools::split_list($plugin_config->{'gateway-external-peers'}) if $plugin_config->{'gateway-external-peers'};
 
     return if !$asn;
 
diff --git a/PVE/Network/SDN/Zones/EvpnPlugin.pm b/PVE/Network/SDN/Zones/EvpnPlugin.pm
index 95fbb64..b2f57ee 100644
--- a/PVE/Network/SDN/Zones/EvpnPlugin.pm
+++ b/PVE/Network/SDN/Zones/EvpnPlugin.pm
@@ -52,7 +52,7 @@ sub generate_sdn_config {
     die "missing vxlan tag" if !$tag;
     warn "vlan-aware vnet can't be enabled with evpn plugin" if $vnet->{vlanaware};
 
-    my @peers = split(',', $controller->{'peers'});
+    my @peers = PVE::Tools::split_list($controller->{'peers'});
     my ($ifaceip, $iface) = PVE::Network::SDN::Zones::Plugin::find_local_ip_interface_peers(\@peers);
 
     my $mtu = 1450;
diff --git a/PVE/Network/SDN/Zones/VxlanPlugin.pm b/PVE/Network/SDN/Zones/VxlanPlugin.pm
index bc585c6..5f17e15 100644
--- a/PVE/Network/SDN/Zones/VxlanPlugin.pm
+++ b/PVE/Network/SDN/Zones/VxlanPlugin.pm
@@ -50,7 +50,7 @@ sub generate_sdn_config {
     my $ipv6 = $vnet->{ipv6};
     my $mac = $vnet->{mac};
     my $multicastaddress = $plugin_config->{'multicast-address'};
-    my @peers = split(',', $plugin_config->{'peers'}) if $plugin_config->{'peers'};
+    my @peers = PVE::Tools::split_list($plugin_config->{'peers'}) if $plugin_config->{'peers'};
     my $vxlan_iface = "vxlan_$vnetid";
 
     die "missing vxlan tag" if !$tag;
-- 
2.20.1




More information about the pve-devel mailing list