]> git.proxmox.com Git - pve-manager.git/commitdiff
network api : reload : don't allow openswitch at all
authorAlexandre Derumier <aderumier@odiso.com>
Thu, 13 Jun 2019 13:49:01 +0000 (15:49 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 14 Jun 2019 07:14:58 +0000 (09:14 +0200)
ifupdown2 reload can't work with openswitch until we implement
ovs.

I don't think that too much users are mixing ovs && bridge anyway.

It's possible to use ifupdown2 with ovs for ifup/down with ifupdown script,
but config need to be changed, and I don't have tested too much.
(maybe add a conflict in ifupdown2 package with openvswitch package for now)

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
PVE/API2/Network.pm

index 152b23f70cfc074536ee8eaf83b5a1c72906ca35..f1982e5e0d071aeabc83e24790e025caa61bbcd8 100644 (file)
@@ -541,64 +541,7 @@ __PACKAGE__->register_method({
        my $new_config_file = "/etc/network/interfaces.new";
 
        die "you need ifupdown2 to reload networking\n" if !-e '/usr/share/ifupdown2';
-
-       #clean-me
-       my $fh = IO::File->new("<$current_config_file");
-       my $running_config = PVE::INotify::read_etc_network_interfaces(1,$fh);
-       $fh->close();
-
-       #clean-me
-       $fh = IO::File->new("<$new_config_file");
-       my $new_config = PVE::INotify::read_etc_network_interfaces(1,$fh);
-       $fh->close();
-
-       my $ovs_changes = undef;
-       my $running_ifaces = $running_config->{ifaces};
-       my $new_ifaces = $new_config->{ifaces};
-
-       foreach my $iface (keys %$running_ifaces) {
-           my $running_iface = $running_ifaces->{$iface};
-           my $type = $running_iface->{type};
-           my $new_iface = $new_ifaces->{$iface};
-           my $new_type = $new_iface->{type};
-
-           if ($type =~ m/^OVS/) {
-               #deleted ovs
-               $ovs_changes = 1 if !defined($new_iface);
-               #change ovs type to new type
-               $ovs_changes = 1 if $new_type ne $type;
-               #deleted or changed option
-               foreach my $iface_option (keys %$running_iface) {
-                   if (!defined($new_iface->{$iface_option}) || ($running_iface->{$iface_option} ne $new_iface->{$iface_option})) {
-                       $ovs_changes = 1;
-                   }
-               }
-           } else {
-               #change type to ovs
-               $ovs_changes = 1 if $new_type =~ m/^OVS/;
-           }
-       }
-
-       foreach my $iface (keys %$new_ifaces) {
-           my $new_iface = $new_ifaces->{$iface};
-           my $new_type = $new_iface->{type};
-           my $running_iface = $running_ifaces->{$iface};
-           my $type = $running_iface->{type};
-
-           if ($new_type =~ m/^OVS/) {
-               #new ovs
-               $ovs_changes = 1 if !defined($running_iface);
-               #new option
-               foreach my $iface_option (keys %$new_iface) {
-                   if (!defined($running_iface->{$iface_option})) {
-                       $ovs_changes = 1;
-                   }
-               }
-           }
-       }
-
-       die "reloading config with ovs changes is not possible currently\n"
-           if $ovs_changes;
+       die "ifupdown2 reload is not compatible if openvswitch currently" if -x '/usr/bin/ovs-vsctl';
 
        my $worker = sub {