mirror of
https://git.proxmox.com/git/pve-network
synced 2025-08-16 20:13:00 +00:00
code/whitespace cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
d73c7c3668
commit
65723efd38
@ -83,7 +83,7 @@ sub generate_controller_config {
|
|||||||
my $interfaces_config = PVE::INotify::read_etc_network_interfaces(1,$fh);
|
my $interfaces_config = PVE::INotify::read_etc_network_interfaces(1,$fh);
|
||||||
$fh->close();
|
$fh->close();
|
||||||
|
|
||||||
#check uplinks
|
# check uplinks
|
||||||
my $uplinks = {};
|
my $uplinks = {};
|
||||||
foreach my $id (keys %{$interfaces_config->{ifaces}}) {
|
foreach my $id (keys %{$interfaces_config->{ifaces}}) {
|
||||||
my $interface = $interfaces_config->{ifaces}->{$id};
|
my $interface = $interfaces_config->{ifaces}->{$id};
|
||||||
@ -94,7 +94,7 @@ sub generate_controller_config {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#generate configuration
|
# generate configuration
|
||||||
my $config = {};
|
my $config = {};
|
||||||
|
|
||||||
foreach my $id (sort keys %{$controller_cfg->{ids}}) {
|
foreach my $id (sort keys %{$controller_cfg->{ids}}) {
|
||||||
|
@ -227,7 +227,6 @@ sub status {
|
|||||||
|
|
||||||
my $status = ifquery_check();
|
my $status = ifquery_check();
|
||||||
|
|
||||||
|
|
||||||
my $vnet_cfg = $cfg->{vnets};
|
my $vnet_cfg = $cfg->{vnets};
|
||||||
my $zone_cfg = $cfg->{zones};
|
my $zone_cfg = $cfg->{zones};
|
||||||
my $nodename = PVE::INotify::nodename();
|
my $nodename = PVE::INotify::nodename();
|
||||||
|
@ -21,7 +21,7 @@ sub read_sdn_config {
|
|||||||
open my $in, '<', $file or die $!;
|
open my $in, '<', $file or die $!;
|
||||||
my $sdn_config;
|
my $sdn_config;
|
||||||
{
|
{
|
||||||
local $/; # slurp mode
|
local $/; # slurp mode
|
||||||
$sdn_config = eval <$in>;
|
$sdn_config = eval <$in>;
|
||||||
}
|
}
|
||||||
close $in;
|
close $in;
|
||||||
@ -92,7 +92,7 @@ foreach my $test (@tests) {
|
|||||||
my $expected = read_file("./$test/expected_sdn_interfaces");
|
my $expected = read_file("./$test/expected_sdn_interfaces");
|
||||||
|
|
||||||
my $result = "";
|
my $result = "";
|
||||||
eval {
|
eval {
|
||||||
$result = PVE::Network::SDN::Zones::generate_etc_network_config();
|
$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 $expected = read_file("./$test/expected_controller_config");
|
||||||
my $controller_rawconfig = "";
|
my $controller_rawconfig = "";
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
my $config = PVE::Network::SDN::Controllers::generate_controller_config();
|
my $config = PVE::Network::SDN::Controllers::generate_controller_config();
|
||||||
$controller_rawconfig = PVE::Network::SDN::Controllers::generate_controller_rawconfig($config);
|
$controller_rawconfig = PVE::Network::SDN::Controllers::generate_controller_rawconfig($config);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (my $err = $@) {
|
if (my $err = $@) {
|
||||||
fail($name);
|
fail($name);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,29 +1,50 @@
|
|||||||
{
|
{
|
||||||
version => 1,
|
version => 1,
|
||||||
vnets => {
|
vnets => {
|
||||||
ids => {
|
ids => {
|
||||||
myvnet => { tag => "100", type => "vnet", zone => "myzone" },
|
myvnet => {
|
||||||
},
|
tag => "100",
|
||||||
},
|
type => "vnet",
|
||||||
|
zone => "myzone",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
zones => {
|
zones => {
|
||||||
ids => { myzone => { ipam => "pve", type => "evpn", controller => "evpnctl", 'vrf-vxlan' => 1000 } },
|
ids => {
|
||||||
},
|
myzone => {
|
||||||
controllers => {
|
ipam => "pve",
|
||||||
ids => {
|
type => "evpn",
|
||||||
evpnctl => { type => "evpn", 'peers' => '192.168.0.1,192.168.0.2,192.168.0.3', asn => "65000" },
|
controller => "evpnctl",
|
||||||
localhost => { type => "bgp", 'peers' => '192.168.0.252,192.168.0.253', ebgp => "1", 'ebgp-multihop' => '3', asn => "65001", node => "localhost" },
|
'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 => {
|
subnets => {
|
||||||
ids => { 'myzone-10.0.0.0-24' => {
|
ids => {
|
||||||
'type' => 'subnet',
|
'myzone-10.0.0.0-24' => {
|
||||||
'vnet' => 'myvnet',
|
'type' => 'subnet',
|
||||||
'gateway' => '10.0.0.1',
|
'vnet' => 'myvnet',
|
||||||
}
|
'gateway' => '10.0.0.1',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user