[pve-devel] [PATCH pve-container] setup/debian: remove superfluous parameter

Wolfgang Bumiller w.bumiller at proxmox.com
Fri Oct 16 09:44:22 CEST 2015


The $new parameter only guards the output of the 'auto' line
which is now being tracked in $done_auto, so it's not
needed anymore.
---
 src/PVE/LXC/Setup/Debian.pm | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/PVE/LXC/Setup/Debian.pm b/src/PVE/LXC/Setup/Debian.pm
index da35494..4b423cc 100644
--- a/src/PVE/LXC/Setup/Debian.pm
+++ b/src/PVE/LXC/Setup/Debian.pm
@@ -118,14 +118,12 @@ sub setup_network {
     my $done_v6_hash = {};
 
     my $print_section = sub {
-	my ($new) = @_;
-
 	return if !$section;
 
 	my $ifname = $section->{ifname};
 	my $net = $networks->{$ifname};
 
-	if ($new && !$done_auto->{$ifname}) {
+	if (!$done_auto->{$ifname}) {
 	    $interfaces .= "auto $ifname\n";
 	    $done_auto->{$ifname} = 1;
 	}
@@ -247,12 +245,12 @@ sub setup_network {
 	if (!$done_v4_hash->{$ifname} && defined($net->{address})) {
 	    if ($need_separator) { $interfaces .= "\n"; $need_separator = 0; };
 	    $section = { type => 'ipv4', ifname => $ifname, attr => []};
-	    &$print_section(1);
+	    &$print_section();
 	}
 	if (!$done_v6_hash->{$ifname} && defined($net->{address6})) {
 	    if ($need_separator) { $interfaces .= "\n"; $need_separator = 0; };
 	    $section = { type => 'ipv6', ifname => $ifname, attr => []};
-	    &$print_section(1);
+	    &$print_section();
 	}
     }
 
-- 
2.1.4





More information about the pve-devel mailing list