ceph: a little luminous backwards compatibility

ceph luminous does not use the 'name' property in the metadata
everywhere, so fall back to 'id'

this makes the ceph dashboard usable while having still luminous
(relevant for upgrading)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2019-06-11 11:14:22 +02:00 committed by Thomas Lamprecht
parent 06064872c2
commit 46fb9c5017
2 changed files with 3 additions and 2 deletions

View File

@ -664,7 +664,7 @@ __PACKAGE__->register_method ({
my $services = $rados->mon_command({ prefix => "$type metadata" });
for my $service ( @$services ) {
my $hostname = $service->{hostname};
my $servicename = $service->{name};
my $servicename = $service->{name} // $service->{id};
my $id = "$servicename\@$hostname";
if ($data->{$id}) {

View File

@ -111,7 +111,8 @@ sub get_services_info {
}
my $metadata = $rados->mon_command({ prefix => "$type metadata" });
foreach my $info (@$metadata) {
my $service = $result->{$info->{name}};
my $id = $info->{name} // $info->{id};
my $service = $result->{$id};
$service->{ceph_version_short} = $info->{ceph_version_short};
$service->{ceph_version} = $info->{ceph_version};
$service->{host} //= $info->{hostname};