mirror of
https://git.proxmox.com/git/pve-guest-common
synced 2025-07-27 10:51:59 +00:00
config: ensure definedness for iterating pending & snapshot volumes
while it will work as is, autovivification can be a real PITA so this should make it more robust and might even avoid having the one or other warning about accessing undef values in logs. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
c788e7c8d1
commit
c95b563b7b
@ -508,12 +508,17 @@ sub update_volume_ids {
|
|||||||
};
|
};
|
||||||
|
|
||||||
$class->foreach_volume_full($conf, $opts, $do_replace, $conf);
|
$class->foreach_volume_full($conf, $opts, $do_replace, $conf);
|
||||||
foreach my $snap (keys %{$conf->{snapshots}}) {
|
|
||||||
my $snap_conf = $conf->{snapshots}->{$snap};
|
if (defined($conf->{snapshots})) {
|
||||||
$class->foreach_volume_full($snap_conf, $opts, $do_replace, $snap_conf);
|
for my $snap (keys %{$conf->{snapshots}}) {
|
||||||
|
my $snap_conf = $conf->{snapshots}->{$snap};
|
||||||
|
$class->foreach_volume_full($snap_conf, $opts, $do_replace, $snap_conf);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$class->foreach_volume_full($conf->{pending}, $opts, $do_replace, $conf->{pending});
|
if (defined($conf->{pending})) {
|
||||||
|
$class->foreach_volume_full($conf->{pending}, $opts, $do_replace, $conf->{pending});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Returns whether the template parameter is set in $conf.
|
# Returns whether the template parameter is set in $conf.
|
||||||
|
Loading…
Reference in New Issue
Block a user