ceph: services: improve addr selection

we map '$type addr' to '$type_addr' anyway in the ceph.conf parser,
so this is not necessary

also use 'public_addr' if it is set

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2019-07-03 15:53:42 +02:00 committed by Thomas Lamprecht
parent 217dde83f0
commit 342de4e778

View File

@ -98,7 +98,7 @@ sub get_services_info {
if ($section =~ m/^$type\.(\S+)$/) {
my $id = $1;
my $service = $result->{$id};
my $addr = $d->{"$type addr"} // $d->{"${type}_addr"} // $d->{host};
my $addr = $d->{"${type}_addr"} // $d->{public_addr} // $d->{host};
$service->{name} //= $id;
$service->{addr} //= $addr;
$service->{state} //= 'unknown';