5
0
mirror of git://git.proxmox.com/git/pve-guest-common.git synced 2025-03-12 20:58:20 +03:00

fix config_with_pending_array for falsy current values

one could have a config with:
> acpi: 0

and a pending deletion for that to restore the default 1 value.

The config_with_pending_array method then pushed the key twice, one
in the loop iterating the config itself correctly and once in the
pending delete hash, which is normally only for those options not yet
referenced in the config at all. Here the check was on "truthiness"
not definedness, fix that.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2020-05-20 17:00:55 +02:00
parent 4826847217
commit 43c899e407

View File

@ -231,8 +231,8 @@ sub config_with_pending_array {
}
while (my ($opt, $force) = each %$pending_delete_hash) {
next if $conf->{pending}->{$opt}; # just to be sure
next if $conf->{$opt};
next if defined($conf->{pending}->{$opt});
next if defined($conf->{$opt});
my $item = { key => $opt, delete => ($force ? 2 : 1)};
push @$res, $item;
}