]> git.proxmox.com Git - pve-manager.git/commitdiff
api: ceph: pools: get_storages: set pool name if missing
authorAaron Lauterer <a.lauterer@proxmox.com>
Thu, 13 Oct 2022 10:32:47 +0000 (12:32 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 14 Oct 2022 13:43:53 +0000 (15:43 +0200)
This avoids errors about the use of uninitialized values if the 'pool'
parameter is not present in the storage configuration.

The 'pool' property for an RBD storage config is not mandatory.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
PVE/API2/Ceph/Pools.pm

index 544d56dcb908875c54afd88456094f2ce38f2bda..6c05250e0926cdcb90a894ff7eef70fdaed3f39c 100644 (file)
@@ -321,6 +321,7 @@ my $get_storages = sub {
     foreach my $storeid (keys %$storages) {
        my $curr = $storages->{$storeid};
        next if $curr->{type} ne 'rbd';
+       $curr->{pool} = 'rbd' if !defined $curr->{pool}; # set default
        if (
            $pool eq $curr->{pool} ||
            (defined $curr->{'data-pool'} && $pool eq $curr->{'data-pool'})