Extracted to a function so it can be mocked in tests.
Signed-off-by: Stefan Lendl <s.lendl@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
Tested-by: Max Carrara <m.carrara@proxmox.com>
Reviewed-by: Stefan Hanreich <s.hanreich@proxmox.com>
Tested-by: Stefan Hanreich <s.hanreich@proxmox.com>
return 1;
}
+sub ethers_file {
+ my ($dhcpid) = @_;
+ return "$DNSMASQ_CONFIG_ROOT/$dhcpid/ethers";
+}
+
sub add_ip_mapping {
my ($class, $dhcpid, $macdb, $mac, $ip4, $ip6) = @_;
- my $ethers_file = "$DNSMASQ_CONFIG_ROOT/$dhcpid/ethers";
+ my $ethers_file = ethers_file($dhcpid);
my $ethers_tmp_file = "$ethers_file.tmp";
my $reload = undef;