summaryrefslogtreecommitdiff
path: root/src/PVE/Network/SDN/Ipams/PVEPlugin.pm
diff options
context:
space:
mode:
authorStefan Hanreich <s.hanreich@proxmox.com>2025-08-01 14:10:27 +0200
committerThomas Lamprecht <t.lamprecht@proxmox.com>2025-08-01 15:15:08 +0200
commit3245a20d7c501e524b4899b923dea66b9475faff (patch)
treeb78f67bdb6be1261e3ff1038f5ac2b554626719e /src/PVE/Network/SDN/Ipams/PVEPlugin.pm
parent37c2156ce8b26d6fb5e6e173b660841eb64a83cd (diff)
ipam: remove fallback code for ipam.db and mac cache
With the upgrade to PVE 9, those files should have been successfully migrated on all nodes, so we do not need to fallback on the old files anymore. Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com> Link: https://lore.proxmox.com/20250801121029.201766-4-s.hanreich@proxmox.com
Diffstat (limited to 'src/PVE/Network/SDN/Ipams/PVEPlugin.pm')
-rw-r--r--src/PVE/Network/SDN/Ipams/PVEPlugin.pm28
1 files changed, 1 insertions, 27 deletions
diff --git a/src/PVE/Network/SDN/Ipams/PVEPlugin.pm b/src/PVE/Network/SDN/Ipams/PVEPlugin.pm
index 6764d79..d2aba1e 100644
--- a/src/PVE/Network/SDN/Ipams/PVEPlugin.pm
+++ b/src/PVE/Network/SDN/Ipams/PVEPlugin.pm
@@ -14,37 +14,11 @@ use Digest::SHA;
use base('PVE::Network::SDN::Ipams::Plugin');
my $ipamdb_file = "sdn/pve-ipam-state.json";
-my $ipamdb_file_legacy = "priv/ipam.db";
PVE::Cluster::cfs_register_file(
$ipamdb_file,
- sub {
- my ($filename, $data) = @_;
- if (defined($data)) {
- return PVE::Network::SDN::Ipams::PVEPlugin->parse_config($filename, $data);
- } else {
- # TODO: remove legacy state file handling with PVE 9+ after ensuring all call sites got
- # switched over.
- return cfs_read_file($ipamdb_file_legacy);
- }
- },
- sub {
- my ($filename, $data) = @_;
- # TODO: remove below with PVE 9+, add a pve8to9 check to allow doing so.
- if (-e $ipamdb_file_legacy && -e $ipamdb_file) {
- # only clean-up if we succeeded to write the new path at least once
- unlink $ipamdb_file_legacy
- or $!{ENOENT}
- or warn "failed to unlink legacy IPAM DB - $!\n";
- }
- return PVE::Network::SDN::Ipams::PVEPlugin->write_config($filename, $data);
- },
-);
-
-PVE::Cluster::cfs_register_file(
- $ipamdb_file_legacy,
sub { PVE::Network::SDN::Ipams::PVEPlugin->parse_config(@_); },
- undef, # no writer for legacy file, all must go to the new file.
+ sub { PVE::Network::SDN::Ipams::PVEPlugin->write_config(@_); },
);
sub type {