plugin: hooks: add explicit returns

to avoid returning something unexpected. Finish what
afeda18256 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>
This commit is contained in:
Fabian Ebner
2020-11-27 10:35:44 +01:00
committed by Thomas Lamprecht
parent 74dcca3a48
commit f3ccd0ef3d
6 changed files with 20 additions and 0 deletions

View 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 {