From a78fd21f7f5fc68dfe6a40edcbbb9200a4f17a08 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Mon, 27 May 2019 15:41:37 +0200 Subject: [PATCH] followup code cleanup for: broadcast ceph service data to cluster Signed-off-by: Thomas Lamprecht --- PVE/Service/pvestatd.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/PVE/Service/pvestatd.pm b/PVE/Service/pvestatd.pm index 6cbd59fb..acc42fa1 100755 --- a/PVE/Service/pvestatd.pm +++ b/PVE/Service/pvestatd.pm @@ -451,6 +451,7 @@ sub rotate_authkeys { sub update_ceph_services { my $services = PVE::Ceph::Services::get_local_services(); + for my $type (keys %$services) { my $data = encode_json($services->{$type}); PVE::Cluster::broadcast_node_kv("ceph-$type", $data); @@ -459,6 +460,7 @@ sub update_ceph_services { sub update_ceph_version { my ($version) = PVE::Ceph::Tools::get_local_version(1); + if ($version) { PVE::Cluster::broadcast_node_kv("ceph-version", $version); } @@ -523,10 +525,10 @@ sub update_status { syslog('err', "authkey rotation error: $err") if $err; eval { - if (PVE::Ceph::Tools::check_ceph_inited(1)) { - update_ceph_services(); - update_ceph_version(); - } + return if !PVE::Ceph::Tools::check_ceph_inited(1); # "return" from eval + + update_ceph_services(); + update_ceph_version(); }; $err = $@; syslog('err', "error getting ceph services: $err") if $err;