ceph services: get_cluster_service: code cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-10-20 16:28:01 +02:00
parent 656667dbd2
commit b1a3af5c65

View File

@ -85,11 +85,9 @@ sub get_cluster_service {
my ($type) = @_;
my $raw = PVE::Cluster::get_node_kv("ceph-$type");
my $res = {};
for my $host (keys %$raw) {
$res->{$host} = eval { decode_json($raw->{$host}) };
}
my $res = {
map { $_ => eval { decode_json($raw->{$_}) } } keys $raw->%*
};
return $res;
}