From: Thomas Lamprecht Date: Thu, 11 Mar 2021 14:04:26 +0000 (+0100) Subject: qm status: sort hash keys on verbose output X-Git-Url: https://git.proxmox.com/?p=qemu-server.git;a=commitdiff_plain;h=7f0285e133421de164274a70e53e171d23450368 qm status: sort hash keys on verbose output Signed-off-by: Thomas Lamprecht --- diff --git a/PVE/CLI/qm.pm b/PVE/CLI/qm.pm index 1aa273f..f8972bd 100755 --- a/PVE/CLI/qm.pm +++ b/PVE/CLI/qm.pm @@ -100,14 +100,14 @@ sub print_recursive_hash { if (defined($key)) { print "$prefix$key:\n"; } - foreach my $itemkey (keys %$hash) { + for my $itemkey (sort keys %$hash) { print_recursive_hash("\t$prefix", $hash->{$itemkey}, $itemkey); } } elsif (ref($hash) eq 'ARRAY') { if (defined($key)) { print "$prefix$key:\n"; } - foreach my $item (@$hash) { + for my $item (@$hash) { print_recursive_hash("\t$prefix", $item); } } elsif ((!ref($hash) && defined($hash)) || ref($hash) eq 'JSON::PP::Boolean') {