nic_updateable: Move clearing of update to write_recap

for readability (the logic that uses the `update` boolean should be
responsible for clearing it).
This commit is contained in:
Richard Hansen 2024-08-26 02:18:43 -04:00
parent 5256a1d02c
commit 25fac765a0
2 changed files with 2 additions and 2 deletions

View file

@ -1573,6 +1573,7 @@ sub write_recap {
# `$recap{$h}` doesn't exist, and that check is done before the force-if-config-changed # `$recap{$h}` doesn't exist, and that check is done before the force-if-config-changed
# check.) # check.)
if (!exists $recap{$h} || $config{$h}{'update'}) { if (!exists $recap{$h} || $config{$h}{'update'}) {
delete($config{$h}{'update'});
$recap{$h} = {}; $recap{$h} = {};
for my $v (keys(%$vars)) { for my $v (keys(%$vars)) {
next if !$vars->{$v}{recap} || !defined(opt($v, $h)); next if !$vars->{$v}{recap} || !defined(opt($v, $h));
@ -3606,7 +3607,7 @@ sub nic_updateable {
} }
} }
delete($config{$host}{$_}) for qw(status-ipv4 status-ipv6 update); delete($config{$host}{$_}) for qw(status-ipv4 status-ipv6);
if ($update) { if ($update) {
$config{$host}{'update'} = 1; $config{$host}{'update'} = 1;
$config{$host}{'atime'} = $now; $config{$host}{'atime'} = $now;

View file

@ -345,7 +345,6 @@ for my $tc (@test_cases) {
Names => ['*got', '*want'])); Names => ['*got', '*want']));
} }
my %want_cfg = (host => { my %want_cfg = (host => {
$tc->{want_update} ? (update => 1) : (),
%cfg, %cfg,
%{$tc->{want_cfg_changes} // {}}, %{$tc->{want_cfg_changes} // {}},
}); });