api: ceph: $get_storages check if data-pool too

When removing a pool, we check against any storage that might have that
pool configured.
We need to check if that pool is used as data-pool too.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
This commit is contained in:
Aaron Lauterer 2022-04-28 13:58:05 +02:00 committed by Thomas Lamprecht
parent fa0fc52008
commit 1eb6072f49

View File

@ -302,8 +302,13 @@ my $get_storages = sub {
my $res = {};
foreach my $storeid (keys %$storages) {
my $curr = $storages->{$storeid};
$res->{$storeid} = $storages->{$storeid}
if $curr->{type} eq 'rbd' && $pool eq $curr->{pool};
next if $curr->{type} ne 'rbd';
if (
$pool eq $curr->{pool} ||
(defined $curr->{'data-pool'} && $pool eq $curr->{'data-pool'})
) {
$res->{$storeid} = $storages->{$storeid};
}
}
return $res;