]> git.proxmox.com Git - pve-manager.git/commitdiff
api: ceph pool create: replace left-over complex error handling
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 21 Apr 2021 15:34:22 +0000 (17:34 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 21 Apr 2021 15:34:23 +0000 (17:34 +0200)
this was from the time where we had a loop here to add two storages,
one for KRDB-only and one for KRBD-never. Nowadays we can handle the
mixed case just fine, but the patch dropping that forget to cleanup
the error handling..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/API2/Ceph/Pools.pm

index b7b1460e0027162366332c64b30e8e7bf888fa6e..002f7893d4ca37f30e2492d47c20e63453e85fa0 100644 (file)
@@ -370,14 +370,8 @@ __PACKAGE__->register_method ({
            PVE::Ceph::Tools::create_pool($pool, $param);
 
            if ($add_storages) {
-               my $err;
-               eval { $add_storage->($pool, "${pool}"); };
-               if ($@) {
-                   warn "failed to add storage: $@";
-                   $err = 1;
-               }
-               die "adding storage for pool '$pool' failed, check log and add manually!\n"
-                   if $err;
+               eval { $add_storage->($pool, "${pool}") };
+               die "adding PVE storage for ceph pool '$pool' failed: $@\n" if $@;
            }
        };