]> git.proxmox.com Git - pve-storage.git/commitdiff
plugin: hooks: add explicit returns
authorFabian Ebner <f.ebner@proxmox.com>
Fri, 27 Nov 2020 09:35:44 +0000 (10:35 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 27 Nov 2020 09:45:42 +0000 (10:45 +0100)
to avoid returning something unexpected. Finish what
afeda182566292be15413d9b874720876eac14c9 already started for all the other
plugins. At least for ZFS's on_add_hook this is necessary (adding a ZFS storage
currently fails as reported here [0]), but it cannot hurt
in the other places either as the only hooks we expect to return something
currently are PBS's on_add_hook and on_update_hook.

[0]: https://forum.proxmox.com/threads/gui-add-zfs-storage-verification-failed-400-config-type-check-object-failed.79734/

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
PVE/Storage/CIFSPlugin.pm
PVE/Storage/CephFSPlugin.pm
PVE/Storage/LVMPlugin.pm
PVE/Storage/PBSPlugin.pm
PVE/Storage/RBDPlugin.pm
PVE/Storage/ZFSPoolPlugin.pm

index 7ec71642f925679a27c56d9bb6128e0c7d0727a7..36339dbe5ba8ac0e31d14c1b3260235974e50e20 100644 (file)
@@ -168,6 +168,8 @@ sub on_add_hook {
     } else {
        cifs_delete_credentials($storeid);
     }
+
+    return;
 }
 
 sub on_update_hook {
@@ -183,12 +185,16 @@ sub on_update_hook {
     } else {
        cifs_delete_credentials($storeid);
     }
+
+    return;
 }
 
 sub on_delete_hook {
     my ($class, $storeid, $scfg) = @_;
 
     cifs_delete_credentials($storeid);
+
+    return;
 }
 
 sub status {
index 880ec05266e557a5f4f1187fca32c697f1fa7b84..8eb7c70bc4086b6eff4d50039ce248402cd53c86 100644 (file)
@@ -170,6 +170,8 @@ sub on_add_hook {
     return if defined($scfg->{monhost}); # nothing to do if not pve managed ceph
 
     PVE::CephConfig::ceph_create_keyfile($scfg->{type}, $storeid);
+
+    return;
 }
 
 sub on_delete_hook {
@@ -178,6 +180,8 @@ sub on_delete_hook {
     return if defined($scfg->{monhost}); # nothing to do if not pve managed ceph
 
     PVE::CephConfig::ceph_remove_keyfile($scfg->{type}, $storeid);
+
+    return;
 }
 
 sub status {
index c0740d437f61337a0b53e3f54f1036762ae4c6ec..73e8e487a397e24022d274fb5ef0870e16847ae1 100644 (file)
@@ -269,6 +269,8 @@ sub on_add_hook {
 
        lvm_create_volume_group($path, $scfg->{vgname}, $scfg->{shared});
     }
+
+    return;
 }
 
 sub parse_volname {
index d1db4a9f34396e91894b22243c88e97a786753f1..380c9765676975b89bab9a3cf41279cdc9be1171 100644 (file)
@@ -452,6 +452,8 @@ sub on_delete_hook {
 
     pbs_delete_password($scfg, $storeid);
     pbs_delete_encryption_key($scfg, $storeid);
+
+    return;
 }
 
 sub parse_volname {
index 94df89d3c82871db9b665a15f8a75053552816bd..fab6d57592d5c918becd70ba15960ddf18df4fa2 100644 (file)
@@ -317,6 +317,8 @@ sub on_add_hook {
     return if defined($scfg->{monhost}); # nothing to do if not pve managed ceph
 
     PVE::CephConfig::ceph_create_keyfile($scfg->{type}, $storeid);
+
+    return;
 }
 
 sub on_delete_hook {
@@ -325,6 +327,8 @@ sub on_delete_hook {
     return if defined($scfg->{monhost}); # nothing to do if not pve managed ceph
 
     PVE::CephConfig::ceph_remove_keyfile($scfg->{type}, $storeid);
+
+    return;
 }
 
 sub parse_volname {
index 2f0a80a4613a6eef0256730c261661745a5ef6ff..30543319c322fe80b38011029e8c1952b2cefaca 100644 (file)
@@ -133,6 +133,8 @@ sub on_add_hook {
     } else {
        $scfg->{mountpoint} = $mountpoint;
     }
+
+    return;
 }
 
 sub path {