]> git.puffer.fish Git - mirror/pve-network.git/commitdiff
zones: code/indendation cleanup
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 28 Apr 2021 11:45:11 +0000 (13:45 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 28 Apr 2021 11:45:11 +0000 (13:45 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/Network/SDN/Ipams.pm
PVE/Network/SDN/Zones.pm
PVE/Network/SDN/Zones/EvpnPlugin.pm
PVE/Network/SDN/Zones/FaucetPlugin.pm
PVE/Network/SDN/Zones/Plugin.pm
PVE/Network/SDN/Zones/VlanPlugin.pm
PVE/Network/SDN/Zones/VxlanPlugin.pm

index 302c4d2dc087e9cbd2a1ac73d2f0d958bad9f9ed..e8a4b0bdd7ada3ebfeef9e7b0b774848af7b5684 100644 (file)
@@ -3,7 +3,6 @@ package PVE::Network::SDN::Ipams;
 use strict;
 use warnings;
 
-use Data::Dumper;
 use JSON;
 
 use PVE::Tools qw(extract_param dir_glob_regex run_command);
index 67d8f188ad319238dfdad3c655942b1414e83b08..bcef427fc0c6bd7c69c33bd98e9e31a2378a9aaa 100644 (file)
@@ -3,7 +3,6 @@ package PVE::Network::SDN::Zones;
 use strict;
 use warnings;
 
-use Data::Dumper;
 use JSON;
 
 use PVE::Tools qw(extract_param dir_glob_regex run_command);
index 8d5250c06d1b60b0f718cb103e1356d863416b07..a4ea8b51ab42330d1dd14d33c6ab7cec7320880d 100644 (file)
@@ -29,21 +29,20 @@ sub properties {
            type => 'string',
            description => "Frr router name",
        },
-        'mac' => {
-            type => 'string',
-            description => "Anycast logical router mac address",
-            optional => 1, format => 'mac-addr'
-        },
+       'mac' => {
+           type => 'string',
+           description => "Anycast logical router mac address",
+           optional => 1, format => 'mac-addr'
+       },
        'exitnodes' => get_standard_option('pve-node-list'),
     };
 }
 
 sub options {
-
     return {
-        nodes => { optional => 1},
-        'vrf-vxlan' => { optional => 0 },
-        controller => { optional => 0 },
+       nodes => { optional => 1},
+       'vrf-vxlan' => { optional => 0 },
+       controller => { optional => 0 },
        exitnodes => { optional => 1 },
        mtu => { optional => 1 },
        mac => { optional => 1 },
index a9f119c9231b7bfa2f7395ff23930b790571b592..a811adabb3f39c44e13ba13715e88f33e743dc44 100644 (file)
@@ -22,12 +22,12 @@ sub properties {
 sub options {
 
     return {
-        nodes => { optional => 1},
+       nodes => { optional => 1},
        'dp-id' => { optional => 0 },
 #      'uplink-id' => { optional => 0 },
-        'controller' => { optional => 0 },
-        dns => { optional => 1 },
-        reversedns => { optional => 1 },
+       'controller' => { optional => 0 },
+       dns => { optional => 1 },
+       reversedns => { optional => 1 },
        dnszone => { optional => 1 },
        ipam => { optional => 0 },
     };
index 9eabe732b784ad2e0caba5f7fb5835c443abbeb0..169869d1da5918dfd9949d5bf9abdb97e0c90f8a 100644 (file)
@@ -8,13 +8,14 @@ use PVE::JSONSchema;
 use PVE::Cluster;
 use PVE::Network;
 
-use Data::Dumper;
 use PVE::JSONSchema qw(get_standard_option);
 use base qw(PVE::SectionConfig);
 
-PVE::Cluster::cfs_register_file('sdn/zones.cfg',
-                                sub { __PACKAGE__->parse_config(@_); },
-                                sub { __PACKAGE__->write_config(@_); });
+PVE::Cluster::cfs_register_file(
+    'sdn/zones.cfg',
+    sub { __PACKAGE__->parse_config(@_); },
+    sub { __PACKAGE__->write_config(@_); },
+);
 
 PVE::JSONSchema::register_standard_option('pve-sdn-zone-id', {
     description => "The SDN zone object identifier.",
@@ -41,13 +42,14 @@ my $defaultData = {
            type => 'string', format => 'pve-configid',
            type => 'string',
        },
-        nodes => get_standard_option('pve-node-list', { optional => 1 }),
-        zone => get_standard_option('pve-sdn-zone-id',
-            { completion => \&PVE::Network::SDN::Zones::complete_sdn_zone }),
-        ipam => {
-            type => 'string',
-            description => "use a specific ipam",
-        },
+       nodes => get_standard_option('pve-node-list', { optional => 1 }),
+       zone => get_standard_option('pve-sdn-zone-id', {
+           completion => \&PVE::Network::SDN::Zones::complete_sdn_zone,
+       }),
+       ipam => {
+           type => 'string',
+           description => "use a specific ipam",
+       },
     },
 };
 
index cda2a364f2a1631d9a0d2a4a0c871c4a56a3bbc0..93a60a0301bd7ee51acd0a8bcf41222689375583 100644 (file)
@@ -31,13 +31,13 @@ sub properties {
 sub options {
 
     return {
-        nodes => { optional => 1},
+       nodes => { optional => 1},
        'bridge' => { optional => 0 },
        mtu => { optional => 1 },
        dns => { optional => 1 },
        reversedns => { optional => 1 },
        dnszone => { optional => 1 },
-        ipam => { optional => 0 },
+       ipam => { optional => 0 },
     };
 }
 
index c018d349859bb663884bf1b775407371d6ee9fe9..792e02de902133234025fe03b7b1bab0329e326f 100644 (file)
@@ -33,10 +33,9 @@ sub properties {
 }
 
 sub options {
-
     return {
-        nodes => { optional => 1},
-        peers => { optional => 0 },
+       nodes => { optional => 1},
+       peers => { optional => 0 },
        mtu => { optional => 1 },
        dns => { optional => 1 },
        reversedns => { optional => 1 },
@@ -68,7 +67,7 @@ sub generate_sdn_config {
     my @iface_config = ();
     push @iface_config, "vxlan-id $tag";
 
-    foreach my $address (@peers) {
+    for my $address (@peers) {
        next if $address eq $ifaceip;
        push @iface_config, "vxlan_remoteip $address";
     }
@@ -82,9 +81,9 @@ sub generate_sdn_config {
     push @iface_config, "bridge_ports $vxlan_iface";
     push @iface_config, "bridge_stp off";
     push @iface_config, "bridge_fd 0";
-    if($vnet->{vlanaware}) {
-        push @iface_config, "bridge-vlan-aware yes";
-        push @iface_config, "bridge-vids 2-4094";
+    if ($vnet->{vlanaware}) {
+       push @iface_config, "bridge-vlan-aware yes";
+       push @iface_config, "bridge-vids 2-4094";
     }
     push @iface_config, "mtu $mtu" if $mtu;
     push @iface_config, "alias $alias" if $alias;
@@ -103,7 +102,7 @@ sub vnet_update_hook {
     raise_param_exc({ tag => "vxlan tag max value is 16777216"}) if $tag > 16777216;
 
     # verify that tag is not already defined globally (vxlan-id are unique)
-    foreach my $id (keys %{$vnet_cfg->{ids}}) {
+    for my $id (sort keys %{$vnet_cfg->{ids}}) {
        next if $id eq $vnetid;
        my $othervnet = $vnet_cfg->{ids}->{$id};
        my $other_tag = $othervnet->{tag};