]> git.proxmox.com Git - pve-manager.git/commitdiff
ceph: osd list: add hostversions to the host nodes
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 19 Jul 2019 08:17:00 +0000 (10:17 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 22 Jul 2019 13:52:07 +0000 (15:52 +0200)
we want to improve the version hints in the osd tree gui and need
the version at the host nodes

we could (and want to) workaround it in the gui to have that
info for both versions of the api call

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
PVE/API2/Ceph/OSD.pm

index 954859e9f2059bf6b6f4c02afad253a7501324ea..649e386f5ca09ee689c5ff05a60ecd0123d666f3 100644 (file)
@@ -104,6 +104,7 @@ __PACKAGE__->register_method ({
 
        my $nodes = {};
        my $newnodes = {};
+       my $hostversions = PVE::Cluster::get_node_kv("ceph-version");
        foreach my $e (@{$res->{nodes}}) {
            $nodes->{$e->{id}} = $e;
 
@@ -165,6 +166,10 @@ __PACKAGE__->register_method ({
            } else {
                $new->{leaf} = ($e->{id} >= 0) ? 1 : 0;
            }
+
+           if ((my $name = $e->{name}) && $e->{type} eq 'host') {
+               $new->{version} = $hostversions->{$name};
+           }
        }
 
        my $roots = [];
@@ -180,7 +185,7 @@ __PACKAGE__->register_method ({
 
        # we want this for the noout flag
        $data->{flags} = $flags if $flags;
-       $data->{versions} = PVE::Cluster::get_node_kv("ceph-version");
+       $data->{versions} = $hostversions; # for compatibility
 
        return $data;
     }});