[pve-devel] applied: [PATCH storage 5/5] scan storage: order scanned shares alphabetically

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Jul 1 12:13:18 CEST 2020


Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 PVE/CLI/pvesm.pm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/PVE/CLI/pvesm.pm b/PVE/CLI/pvesm.pm
index c5e2d91..4f934d6 100755
--- a/PVE/CLI/pvesm.pm
+++ b/PVE/CLI/pvesm.pm
@@ -434,7 +434,7 @@ __PACKAGE__->register_method ({
 	my $res = PVE::Storage::scan_nfs($server);
 
 	my $data = [];
-	foreach my $k (keys %$res) {
+	foreach my $k (sort keys %$res) {
 	    push @$data, { path => $k, options => $res->{$k} };
 	}
 	return $data;
@@ -503,7 +503,7 @@ __PACKAGE__->register_method ({
 	my $res = PVE::Storage::scan_cifs($server, $username, $password, $domain);
 
 	my $data = [];
-	foreach my $k (keys %$res) {
+	foreach my $k (sort keys %$res) {
 	    push @$data, { share => $k, description => $res->{$k} };
 	}
 
@@ -553,7 +553,7 @@ __PACKAGE__->register_method ({
 	my $res = PVE::Storage::scan_nfs($server);
 
 	my $data = [];
-	foreach my $path (keys %$res) {
+	foreach my $path (sort keys %$res) {
 	    if ($path =~ m!^/([^\s/]+)$!) {
 		push @$data, { volname => $1 };
 	    }
@@ -603,7 +603,7 @@ __PACKAGE__->register_method ({
 	my $res = PVE::Storage::scan_iscsi($param->{portal});
 
 	my $data = [];
-	foreach my $k (keys %$res) {
+	foreach my $k (sort keys %$res) {
 	    push @$data, { target => $k, portal => join(',', @{$res->{$k}}) };
 	}
 
-- 
2.20.1





More information about the pve-devel mailing list