[pve-devel] [RFC pve-network 8/9] ipams : pveplugin: remove del_dhcp_ip

Alexandre Derumier aderumier at odiso.com
Mon Nov 13 11:04:18 CET 2023


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 src/PVE/Network/SDN/Ipams/PVEPlugin.pm | 32 --------------------------
 1 file changed, 32 deletions(-)

diff --git a/src/PVE/Network/SDN/Ipams/PVEPlugin.pm b/src/PVE/Network/SDN/Ipams/PVEPlugin.pm
index 0bc2b65..776eff8 100644
--- a/src/PVE/Network/SDN/Ipams/PVEPlugin.pm
+++ b/src/PVE/Network/SDN/Ipams/PVEPlugin.pm
@@ -189,38 +189,6 @@ sub add_range_next_freeip {
     });
 }
 
-sub del_dhcp_ip {
-    my ($class, $subnet, $mac) = @_;
-
-    my $cidr = $subnet->{cidr};
-    my $zone = $subnet->{zone};
-
-    my $returned_ip = undef;
-
-    cfs_lock_file($ipamdb_file, undef, sub {
-	my $db = read_db();
-
-	die "zone $zone don't exist in ipam db" if !$db->{zones}->{$zone};
-	my $dbzone = $db->{zones}->{$zone};
-
-	die "subnet $cidr don't exist in ipam db" if !$dbzone->{subnets}->{$cidr};
-	my $dbsubnet = $dbzone->{subnets}->{$cidr};
-
-	foreach my $ip_address (keys %{$dbsubnet->{ips}}) {
-	    my $data = $dbsubnet->{ips}->{$ip_address};
-	    next if !$data->{mac} || $data->{mac} ne $mac;
-
-	    delete $dbsubnet->{ips}->{$ip_address};
-	    write_db($db);
-
-	    $returned_ip = $ip_address;
-	}
-    });
-    die "$@" if $@;
-
-    return $returned_ip;
-}
-
 sub del_ip {
     my ($class, $plugin_config, $subnetid, $subnet, $ip) = @_;
 
-- 
2.39.2





More information about the pve-devel mailing list