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:
committed by
Thomas Lamprecht
parent
74dcca3a48
commit
f3ccd0ef3d
@ -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 {
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -269,6 +269,8 @@ sub on_add_hook {
|
||||
|
||||
lvm_create_volume_group($path, $scfg->{vgname}, $scfg->{shared});
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
sub parse_volname {
|
||||
|
||||
@ -452,6 +452,8 @@ sub on_delete_hook {
|
||||
|
||||
pbs_delete_password($scfg, $storeid);
|
||||
pbs_delete_encryption_key($scfg, $storeid);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
sub parse_volname {
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -133,6 +133,8 @@ sub on_add_hook {
|
||||
} else {
|
||||
$scfg->{mountpoint} = $mountpoint;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
sub path {
|
||||
|
||||
Reference in New Issue
Block a user