]> git.proxmox.com Git - pve-container.git/commitdiff
iterate pending config changes sorted
authorOguz Bektas <o.bektas@proxmox.com>
Wed, 23 Oct 2019 16:48:27 +0000 (18:48 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 29 Oct 2019 05:50:05 +0000 (06:50 +0100)
since we sort them while going through the delete hash, we can do it
for the other loops for consistency.

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

index d624b0b2f2068f25579c09d8fc438418e2c25c9d..fc2f86abefa85ab8ce718ecd57db48bd86b24335 100644 (file)
@@ -930,7 +930,7 @@ sub update_pct_config {
            if !$storage_config->{content}->{rootdir};
     };
 
-    foreach my $opt (keys %$param) { # add/change
+    foreach my $opt (sort keys %$param) { # add/change
        $modified->{$opt} = 1;
        my $value = $param->{$opt};
        if ($opt =~ m/^mp(\d+)$/ || $opt eq 'rootfs') {
@@ -1121,7 +1121,7 @@ sub vmconfig_hotplug_pending {
     };
 
     my $changes;
-    foreach my $opt (keys %{$conf->{pending}}) { # add/change
+    foreach my $opt (sort keys %{$conf->{pending}}) { # add/change
        next if $selection && !$selection->{$opt};
        if ($LXC_FASTPLUG_OPTIONS->{$opt}) {
            $conf->{$opt} = delete $conf->{pending}->{$opt};
@@ -1197,7 +1197,7 @@ sub vmconfig_hotplug_pending {
        }
     }
 
-    foreach my $opt (keys %{$conf->{pending}}) {
+    foreach my $opt (sort keys %{$conf->{pending}}) {
        next if $opt eq 'delete'; # just to be sure
        next if $selection && !$selection->{$opt};
        my $value = $conf->{pending}->{$opt};
@@ -1274,7 +1274,7 @@ sub vmconfig_apply_pending {
        }
     }
 
-    foreach my $opt (keys %{$conf->{pending}}) { # add/change
+    foreach my $opt (sort keys %{$conf->{pending}}) { # add/change
        next if $opt eq 'delete'; # just to be sure
        next if $selection && !$selection->{$opt};
        eval {