]> git.proxmox.com Git - pve-storage.git/commitdiff
disk management api: comment how storages are added and cleanup style
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 17 Jun 2023 12:51:20 +0000 (14:51 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 17 Jun 2023 12:57:20 +0000 (14:57 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/API2/Disks/Directory.pm
src/PVE/API2/Disks/LVM.pm
src/PVE/API2/Disks/LVMThin.pm
src/PVE/API2/Disks/ZFS.pm

index 4fdb06874d0754a55ac4e9beba80664db45960b9..efc701a8cabd8caf253711efb89b017ffeedffde 100644 (file)
@@ -221,13 +221,9 @@ __PACKAGE__->register_method ({
        my $verify_params = [qw(path)];
 
        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 $mounted = PVE::Diskmanage::mounted_paths();
@@ -306,11 +302,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);
                }
            });
        };
index fe875452bdaa170040b36a98f493f7876ff51f4b..c091e37049ef877f4e54180290951f30f571c317 100644 (file)
@@ -162,13 +162,9 @@ __PACKAGE__->register_method ({
        my $verify_params = [qw(vgname)];
 
        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 $worker = sub {
@@ -188,11 +184,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);
                }
            });
        };
index 038310a4864c6e82234ee7dc75fbaa2a7ce6b1de..89b6401fd8fa5e399db039142dc09d13375e5eb6 100644 (file)
@@ -120,13 +120,9 @@ __PACKAGE__->register_method ({
        my $verify_params = [qw(vgname thinpool)];
 
        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 $worker = sub {
@@ -167,11 +163,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);
                }
            });
        };
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);
            }
        };