nic_updateable: Don't mutate status-ipv*
vars if not updating
This simplifies the logic a bit and improves readability.
This commit is contained in:
parent
25fac765a0
commit
75552f80f7
1 changed files with 2 additions and 5 deletions
|
@ -3607,15 +3607,12 @@ sub nic_updateable {
|
|||
}
|
||||
}
|
||||
|
||||
delete($config{$host}{$_}) for qw(status-ipv4 status-ipv6);
|
||||
if ($update) {
|
||||
$config{$host}{'update'} = 1;
|
||||
$config{$host}{'atime'} = $now;
|
||||
delete($config{$host}{$_}) for qw(wtime warned-min-interval warned-min-error-interval);
|
||||
delete($config{$host}{$_}) for qw(status-ipv4 status-ipv6 wtime
|
||||
warned-min-interval warned-min-error-interval);
|
||||
} else {
|
||||
for (qw(status-ipv4 status-ipv6)) {
|
||||
$config{$host}{$_} = $recap{$host}{$_} if defined($recap{$host}{$_});
|
||||
}
|
||||
delete($config{$host}{$_}) for qw(wantipv4 wantipv6);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue