]> git.proxmox.com Git - pve-network.git/commitdiff
add on_delete_hook
authorAlexandre Derumier <aderumier@odiso.com>
Thu, 4 Apr 2019 08:18:34 +0000 (10:18 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 4 Apr 2019 09:12:30 +0000 (11:12 +0200)
empty for now

PVE/API2/Network/Network.pm
PVE/Network/Network/Plugin.pm
PVE/Network/Network/VlanPlugin.pm
PVE/Network/Network/VnetPlugin.pm
PVE/Network/Network/VxlanMulticastPlugin.pm

index 20f357478f036720a3a41d766ad4fdcb7113bf42..a647edf40725f57877e5595e77b1a0c660399c26 100644 (file)
@@ -219,12 +219,10 @@ __PACKAGE__->register_method ({
 
                my $scfg = PVE::Network::Network::network_config($cfg, $networkid);
 
-#              my $plugin = PVE::Network::Network::Plugin->lookup($scfg->{type});
-#              $plugin->on_delete_hook($networkid, $scfg);
+               my $plugin = PVE::Network::Network::Plugin->lookup($scfg->{type});
+               $plugin->on_delete_hook($networkid, $scfg);
 
                delete $cfg->{ids}->{$networkid};
-               #improveme:
-               #check that vnet don't use this transport
                PVE::Network::Network::write_config($cfg);
 
            }, "delete network object failed");
index 4ec6d0a7fc909ff15e7c5a5a28748a2cb115cef3..b537535c8713b06b9834c428355833722c982251 100644 (file)
@@ -52,6 +52,12 @@ sub generate_network_config {
     die "please implement inside plugin";
 }
 
+sub on_delete_hook {
+    my ($class, $networkid, $scfg) = @_;
+
+    # do nothing by default
+}
+
 #helpers
 sub parse_tag_number_or_range {
     my ($str, $max, $tag) = @_;
index 6a84f7142552382acdeba25080a4d82c55241d04..c335764de9c2034eedb0e9eaf3a7fc8a74ac8a32 100644 (file)
@@ -96,6 +96,12 @@ sub generate_network_config {
     return $config;
 }
 
+sub on_delete_hook {
+    my ($class, $networkid, $scfg) = @_;
+
+    # verify that no vnet are associated to this transport  
+}
+
 1;
 
 
index a1d49a787c0c7800b0e503d52cbae71443d9d765..983e6a2e332c79ec128d0d2875c9ec74ddac2a54 100644 (file)
@@ -61,5 +61,11 @@ sub options {
     };
 }
 
+sub on_delete_hook {
+    my ($class, $networkid, $scfg) = @_;
+
+    # verify than no vm or ct have interfaces in this bridge
+}
+
 
 1;
index 99383e57fe7a7cede3fb87b6c4610edfa77eb411..901f42542cfa67c66535342afdce342a1a8f67db 100644 (file)
@@ -80,6 +80,12 @@ sub generate_network_config {
     return $config;
 }
 
+sub on_delete_hook {
+    my ($class, $networkid, $scfg) = @_;
+
+    # verify that no vnet are associated to this transport
+}
+
 1;