]> git.proxmox.com Git - pve-storage.git/blobdiff - src/PVE/API2/Disks/ZFS.pm
disk management api: comment how storages are added and cleanup style
[pve-storage.git] / src / PVE / API2 / Disks / ZFS.pm
index a9dc3a7cf5e299317c30058735698e6a4f820162..afd9a3e6818329b16d6bebfbaee3df69063c848a 100644 (file)
@@ -383,13 +383,9 @@ __PACKAGE__->register_method ({
        my $verify_params = [qw(pool)];
 
        if ($param->{add_storage}) {
+           # reserve the name and add as disabled, will be enabled below if creation works out
            PVE::API2::Storage::Config->create_or_update(
-               $name,
-               $node,
-               $storage_params,
-               $verify_params,
-               1,
-           );
+               $name, $node, $storage_params, $verify_params, 1);
        }
 
        my $pools = get_pool_data();
@@ -495,11 +491,7 @@ __PACKAGE__->register_method ({
 
            if ($param->{add_storage}) {
                PVE::API2::Storage::Config->create_or_update(
-                   $name,
-                   $node,
-                   $storage_params,
-                   $verify_params,
-               );
+                   $name, $node, $storage_params, $verify_params);
            }
        };