From 44ae567c383ac6c888f33fcc1c9c348b0deb5edd Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Thu, 27 Jul 2017 12:16:45 +0200 Subject: [PATCH] storage_info: return also disabled storages in the Storage/Status API call we have a 'enabled' param which had no effect because storage_info only returned enabled one way or the other. This affected also `pvesm status` which uses the Storage/Status API call. So push also disabled storages to the info array but only activate and get their status when thei are enabled. Signed-off-by: Thomas Lamprecht --- PVE/Storage.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PVE/Storage.pm b/PVE/Storage.pm index cf1e5ec..5d0b2ba 100755 --- a/PVE/Storage.pm +++ b/PVE/Storage.pm @@ -1012,8 +1012,6 @@ sub storage_info { my $slist = []; foreach my $storeid (keys %$ids) { - next if !storage_check_enabled($cfg, $storeid, undef, 1); - if (defined($content)) { my $want_ctype = 0; foreach my $ctype (@ctypes) { @@ -1035,6 +1033,7 @@ sub storage_info { shared => $ids->{$storeid}->{shared} ? 1 : 0, content => PVE::Storage::Plugin::content_hash_to_string($ids->{$storeid}->{content}), active => 0, + enabled => defined(storage_check_enabled($cfg, $storeid, undef, 1)) ? 1 : 0, }; push @$slist, $storeid; @@ -1043,6 +1042,8 @@ sub storage_info { my $cache = {}; foreach my $storeid (keys %$ids) { + next if !$info->{$storeid}->{enabled}; + my $scfg = $ids->{$storeid}; next if !$info->{$storeid};