]> git.proxmox.com Git - pve-manager.git/commitdiff
pve6to7: try to iterate in a more stable fashion
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 5 Jul 2021 15:37:58 +0000 (17:37 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 5 Jul 2021 15:37:58 +0000 (17:37 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/CLI/pve6to7.pm

index da15ef7da1beb0ed4534dffb4ebfadec0149c116..8a1aafaa7603f0a557b4ee9d54242e4a1f7b6de9 100644 (file)
@@ -207,7 +207,7 @@ sub check_storage_health {
 
     my $info = PVE::Storage::storage_info($cfg);
 
-    foreach my $storeid (keys %$info) {
+    foreach my $storeid (sort keys %$info) {
        my $d = $info->{$storeid};
        if ($d->{enabled}) {
            if ($d->{type} eq 'sheepdog') {
@@ -725,7 +725,7 @@ sub check_storage_content {
     my $potentially_affected = {};
     my $referenced_volids = {};
 
-    for my $storeid (keys $storage_cfg->{ids}->%*) {
+    for my $storeid (sort keys $storage_cfg->{ids}->%*) {
        my $scfg = $storage_cfg->{ids}->{$storeid};
 
        next if !PVE::Storage::storage_check_enabled($storage_cfg, $storeid, undef, 1);
@@ -968,8 +968,8 @@ sub check_containers_cgroup_compat {
        return;
     }
 
-    my @running_cts = grep { $_->{status} eq 'running' } @$cts;
-    my @offline_cts = grep { $_->{status} ne 'running' } @$cts;
+    my @running_cts = sort { $a <=> $b } grep { $_->{status} eq 'running' } @$cts;
+    my @offline_cts = sort { $a <=> $b } grep { $_->{status} ne 'running' } @$cts;
 
     for my $ct (@running_cts) {
        my $ctid = $ct->{vmid};