]> git.proxmox.com Git - pve-container.git/commitdiff
pending apply/hotplug: use normal for loop iterate over
authorOguz Bektas <o.bektas@proxmox.com>
Tue, 22 Oct 2019 10:40:41 +0000 (12:40 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 22 Oct 2019 11:00:59 +0000 (13:00 +0200)
format of pending_delete_hash is changed in guest-common, so we have to
use the new format while looping over the hash.

also it make no sense to have a `my ($foo, undef) = each` here, the
undef did nothing anyway.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
src/PVE/LXC/Config.pm

index 916ecca717fd16f5a1254abc21804cafd795062e..1bd30879f4c62e1fd687f7a25a506034fbe13bb3 100644 (file)
@@ -1166,7 +1166,7 @@ sub vmconfig_hotplug_pending {
 
     my $pending_delete_hash = $class->parse_pending_delete($conf->{pending}->{delete});
     # FIXME: $force deletion is not implemented for CTs
-    while (my ($opt, undef) = each %$pending_delete_hash) {
+    foreach my $opt (keys %$pending_delete_hash) {
        next if $selection && !$selection->{$opt};
        eval {
            if ($LXC_FASTPLUG_OPTIONS->{$opt}) {
@@ -1250,7 +1250,7 @@ sub vmconfig_apply_pending {
 
     my $pending_delete_hash = $class->parse_pending_delete($conf->{pending}->{delete});
     # FIXME: $force deletion is not implemented for CTs
-    while (my ($opt, undef) = each %$pending_delete_hash) {
+    foreach my $opt (keys %$pending_delete_hash) {
        next if $selection && !$selection->{$opt};
        $class->cleanup_pending($conf);
        eval {