5
0
mirror of git://git.proxmox.com/git/pve-network.git synced 2025-02-01 09:47:23 +03:00

code/whitespace cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-04-28 16:36:13 +02:00
parent d73c7c3668
commit 65723efd38
4 changed files with 51 additions and 32 deletions

View File

@ -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}}) {

View File

@ -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();

View File

@ -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 {

View File

@ -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',
},
},
},
}