read_recap: Fix iteration over hosts

This commit is contained in:
Richard Hansen 2024-08-22 02:56:50 -04:00
parent 35cbc8d200
commit fbd7167b94

View file

@ -1633,11 +1633,8 @@ sub read_recap {
%opt = (); %opt = ();
$saved_recap = _read_config(\%recap, $globals, "##\\s*$program-$version\\s*", $file); $saved_recap = _read_config(\%recap, $globals, "##\\s*$program-$version\\s*", $file);
%opt = %saved; %opt = %saved;
# TODO: Why is this iterating over `keys(%recap)`? Shouldn't it iterate over `keys(%config)`
# instead?
for my $h (keys(%recap)) { for my $h (keys(%recap)) {
# TODO: `$recap{$h}` is guaranteed to exist because we're iterating over `keys(%recap)`. next if !exists($config{$h});
next if !exists($recap{$h});
# Only status variables are copied from `%recap` into `%config` because the recap should # Only status variables are copied from `%recap` into `%config` because the recap should
# not change the configuration. See the documenting comments for `%recap`. # not change the configuration. See the documenting comments for `%recap`.
# TODO: Hard-coding this list impairs readability and maintainability. In particular, # TODO: Hard-coding this list impairs readability and maintainability. In particular,