ceph: services: refactor version existence check as guard clause

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Igor Thaller <igor.thaller@brg9.at>
This commit is contained in:
Max Carrara 2024-07-01 16:10:34 +02:00 committed by Thomas Lamprecht
parent f09b26ae56
commit ddf6263191

View File

@ -50,7 +50,8 @@ sub broadcast_ceph_services {
sub broadcast_ceph_versions {
my ($version, $buildcommit, $vers_parts) = PVE::Ceph::Tools::get_local_version(1);
if ($version) {
return undef if !$version;
my $nodename = PVE::INotify::nodename();
my $old = PVE::Cluster::get_node_kv("ceph-versions", $nodename);
if (defined($old->{$nodename})) {
@ -70,7 +71,6 @@ sub broadcast_ceph_versions {
};
PVE::Cluster::broadcast_node_kv("ceph-versions", encode_json($node_versions));
}
}
sub get_ceph_versions {
my $res;