[pve-devel] [PATCH manager v3 11/20] ceph/destroypool: refactor to use get_storages

Fabian Grünbichler f.gruenbichler at proxmox.com
Thu Aug 31 11:38:14 CEST 2017


Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
re-introduced in v3

 PVE/API2/Ceph.pm | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/PVE/API2/Ceph.pm b/PVE/API2/Ceph.pm
index 5620d6b3..a462056f 100644
--- a/PVE/API2/Ceph.pm
+++ b/PVE/API2/Ceph.pm
@@ -1847,10 +1847,8 @@ __PACKAGE__->register_method ({
 	# vm disks are on it anymore
 	if (!$param->{force}) {
 	    my $storagecfg = PVE::Storage::config();
-	    foreach my $storageid (keys %{$storagecfg->{ids}}) {
-		my $storage = $storagecfg->{ids}->{$storageid};
-		next if $storage->{type} ne 'rbd';
-		next if $storage->{pool} ne $pool;
+	    foreach my $storageid (keys %$storages) {
+		my $storage = $storages->{$storageid};
 
 		# check if any vm disks are on the pool
 		my $res = PVE::Storage::vdisk_list($storagecfg, $storageid);
-- 
2.11.0





More information about the pve-devel mailing list