summaryrefslogtreecommitdiff
path: root/src/PVE/Network/SDN/Ipams.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.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.pm')
-rw-r--r--src/PVE/Network/SDN/Ipams.pm30
1 files changed, 1 insertions, 29 deletions
diff --git a/src/PVE/Network/SDN/Ipams.pm b/src/PVE/Network/SDN/Ipams.pm
index 7ec0f06..00aa20c 100644
--- a/src/PVE/Network/SDN/Ipams.pm
+++ b/src/PVE/Network/SDN/Ipams.pm
@@ -21,35 +21,7 @@ PVE::Network::SDN::Ipams::PhpIpamPlugin->register();
PVE::Network::SDN::Ipams::Plugin->init();
my $macdb_filename = "sdn/mac-cache.json";
-my $macdb_filename_legacy = 'priv/macs.db';
-
-cfs_register_file(
- $macdb_filename,
- sub {
- my ($filename, $data) = @_;
- if (defined($data)) {
- return json_reader($filename, $data);
- } else {
- # TODO: remove legacy cache file handling with PVE 9+ after ensuring all call sites got
- # switched over.
- return cfs_read_file($macdb_filename_legacy);
- }
- },
- sub {
- my ($filename, $data) = @_;
- # TODO: remove below with PVE 9+, add a pve8to9 check to allow doing so.
- if (-e $macdb_filename_legacy && -e $macdb_filename) {
- # only clean-up if we succeeded to write the new path at least once
- unlink $macdb_filename_legacy
- or $!{ENOENT}
- or warn "failed to unlink legacy MAC cache - $!\n";
- }
- return json_writer->($filename, $data);
- },
-);
-
-# drop reading $macdb_filename_legacy with PVE 9+ - for now do not write it anymore.
-cfs_register_file($macdb_filename_legacy, \&json_reader, undef);
+cfs_register_file($macdb_filename, \&json_reader, \&json_writer);
sub json_reader {
my ($filename, $data) = @_;