From: Thomas Lamprecht Date: Wed, 28 Apr 2021 14:36:13 +0000 (+0200) Subject: code/whitespace cleanup X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=65723efd3888596eade4776a968bea36d8317928;p=pve-network.git code/whitespace cleanup Signed-off-by: Thomas Lamprecht --- diff --git a/PVE/Network/SDN/Controllers.pm b/PVE/Network/SDN/Controllers.pm index d61851b..e1cf9e0 100644 --- a/PVE/Network/SDN/Controllers.pm +++ b/PVE/Network/SDN/Controllers.pm @@ -83,7 +83,7 @@ sub generate_controller_config { my $interfaces_config = PVE::INotify::read_etc_network_interfaces(1,$fh); $fh->close(); - #check uplinks + # check uplinks my $uplinks = {}; foreach my $id (keys %{$interfaces_config->{ifaces}}) { my $interface = $interfaces_config->{ifaces}->{$id}; @@ -94,7 +94,7 @@ sub generate_controller_config { } } - #generate configuration + # generate configuration my $config = {}; foreach my $id (sort keys %{$controller_cfg->{ids}}) { diff --git a/PVE/Network/SDN/Zones.pm b/PVE/Network/SDN/Zones.pm index e5c0240..1ccceed 100644 --- a/PVE/Network/SDN/Zones.pm +++ b/PVE/Network/SDN/Zones.pm @@ -227,7 +227,6 @@ sub status { my $status = ifquery_check(); - my $vnet_cfg = $cfg->{vnets}; my $zone_cfg = $cfg->{zones}; my $nodename = PVE::INotify::nodename(); diff --git a/test/run_test_zones.pl b/test/run_test_zones.pl index a788553..12e017a 100755 --- a/test/run_test_zones.pl +++ b/test/run_test_zones.pl @@ -21,7 +21,7 @@ sub read_sdn_config { open my $in, '<', $file or die $!; my $sdn_config; { - local $/; # slurp mode + local $/; # slurp mode $sdn_config = eval <$in>; } close $in; @@ -92,7 +92,7 @@ foreach my $test (@tests) { my $expected = read_file("./$test/expected_sdn_interfaces"); my $result = ""; - eval { + eval { $result = PVE::Network::SDN::Zones::generate_etc_network_config(); }; @@ -106,11 +106,10 @@ foreach my $test (@tests) { my $expected = read_file("./$test/expected_controller_config"); my $controller_rawconfig = ""; - eval { + eval { my $config = PVE::Network::SDN::Controllers::generate_controller_config(); $controller_rawconfig = PVE::Network::SDN::Controllers::generate_controller_rawconfig($config); }; - if (my $err = $@) { fail($name); } else { diff --git a/test/zones/evpn/ebgp/sdn_config b/test/zones/evpn/ebgp/sdn_config index 91c1b61..6e9d116 100644 --- a/test/zones/evpn/ebgp/sdn_config +++ b/test/zones/evpn/ebgp/sdn_config @@ -1,29 +1,50 @@ { - version => 1, - vnets => { - ids => { - myvnet => { tag => "100", type => "vnet", zone => "myzone" }, - }, - }, + version => 1, + vnets => { + ids => { + myvnet => { + tag => "100", + type => "vnet", + zone => "myzone", + }, + }, + }, - zones => { - ids => { myzone => { ipam => "pve", type => "evpn", controller => "evpnctl", 'vrf-vxlan' => 1000 } }, - }, - controllers => { - ids => { - evpnctl => { type => "evpn", 'peers' => '192.168.0.1,192.168.0.2,192.168.0.3', asn => "65000" }, - localhost => { type => "bgp", 'peers' => '192.168.0.252,192.168.0.253', ebgp => "1", 'ebgp-multihop' => '3', asn => "65001", node => "localhost" }, - }, - }, + zones => { + ids => { + myzone => { + ipam => "pve", + type => "evpn", + controller => "evpnctl", + 'vrf-vxlan' => 1000, + }, + }, + }, + controllers => { + ids => { + evpnctl => { + type => "evpn", + 'peers' => '192.168.0.1,192.168.0.2,192.168.0.3', + asn => "65000", + }, + localhost => { + type => "bgp", + 'peers' => '192.168.0.252,192.168.0.253', + ebgp => "1", + 'ebgp-multihop' => '3', + asn => "65001", + node => "localhost", + }, + }, + }, - subnets => { - ids => { 'myzone-10.0.0.0-24' => { - 'type' => 'subnet', - 'vnet' => 'myvnet', - 'gateway' => '10.0.0.1', - } - } - } + subnets => { + ids => { + 'myzone-10.0.0.0-24' => { + 'type' => 'subnet', + 'vnet' => 'myvnet', + 'gateway' => '10.0.0.1', + }, + }, + }, } - -