]> git.proxmox.com Git - pve-common.git/commitdiff
etc_network_interfaces : handle autostart for ovs
authorAlexandre Derumier <aderumier@odiso.com>
Fri, 20 Sep 2019 14:29:53 +0000 (16:29 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 20 Sep 2019 14:39:38 +0000 (16:39 +0200)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
src/PVE/INotify.pm

index 65b2d9113f993898b0bd66941472ac7c501a898f..e224f78e71349e340c19d03a4bdde62bee676ed7 100644 (file)
@@ -902,8 +902,8 @@ sub __read_etc_network_interfaces {
        chomp ($line);
        next if $line =~ m/^\s*#/;
 
-       if ($line =~ m/^\s*auto\s+(.*)$/) {
-           my @aa = split (/\s+/, $1);
+       if ($line =~ m/^\s*(auto|allow-ovs)\s+(.*)$/) {
+           my @aa = split (/\s+/, $2);
 
            foreach my $a (@aa) {
                $ifaces->{$a}->{autostart} = 1;
@@ -1599,11 +1599,13 @@ NETWORKDOC
        }
 
        $printed->{$iface} = 1;
-       if ($d->{type} eq 'OVSBridge') {
-           # cannot use 'auto' for OVS, would add race with systemd ifup@.service
-           $raw .= "allow-ovs $iface\n";
-       } elsif ($d->{autostart}) {
-           $raw .= "auto $iface\n";
+       if ($d->{autostart}) {
+           if ($d->{type} eq 'OVSBridge') {
+               # cannot use 'auto' for OVS, would add race with systemd ifup@.service
+               $raw .= "allow-ovs $iface\n";
+           } else {
+               $raw .= "auto $iface\n";
+           }
        }
 
        my $i = 0; # some options should be printed only once