[pve-devel] [PATCH manager 1/2] api: ceph: fix getting ceph versions

Dominik Csapak d.csapak at proxmox.com
Wed Nov 10 13:15:55 CET 2021


since commit:
fb0cb9b7 ("ceph services: drop broadcasting legacy version pmxcfs KV")

the 'ceph-version' kv is not broadcasted anymore, so we should not query it.
instead use get_ceph_versions

also drop the other legacy keys for the versions

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/API2/Ceph/OSD.pm     | 5 ++---
 PVE/API2/Cluster/Ceph.pm | 5 +----
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/PVE/API2/Ceph/OSD.pm b/PVE/API2/Ceph/OSD.pm
index fbbc2139..a8f48304 100644
--- a/PVE/API2/Ceph/OSD.pm
+++ b/PVE/API2/Ceph/OSD.pm
@@ -106,7 +106,7 @@ __PACKAGE__->register_method ({
 	my $osdmetadata_res = $rados->mon_command({ prefix => 'osd metadata' });
 	my $osdmetadata = { map { $_->{id} => $_ } @$osdmetadata_res };
 
-	my $hostversions = PVE::Cluster::get_node_kv("ceph-version");
+	my $hostversions = PVE::Ceph::Services::get_ceph_versions();
 
 	my $nodes = {};
 	my $newnodes = {};
@@ -176,7 +176,7 @@ __PACKAGE__->register_method ({
 	    }
 
 	    if ($name && $e->{type} eq 'host') {
-		$new->{version} = $hostversions->{$name};
+		$new->{version} = $hostversions->{$name}->{version}->{str};
 	    }
 	}
 
@@ -195,7 +195,6 @@ __PACKAGE__->register_method ({
 		leaf =>  0,
 		children => $realroots
 	    },
-	    versions => $hostversions, # for compatibility
 	};
 
 	$data->{flags} = $flags if $flags; # we want this for the noout flag
diff --git a/PVE/API2/Cluster/Ceph.pm b/PVE/API2/Cluster/Ceph.pm
index 1cc5aff4..7f825003 100644
--- a/PVE/API2/Cluster/Ceph.pm
+++ b/PVE/API2/Cluster/Ceph.pm
@@ -74,10 +74,7 @@ __PACKAGE__->register_method ({
 
 	my $scope = $param->{scope} // 'all';
 
-	my $res = {
-	    # FIXME: remove with 7.0 depreacated by structured 'versions'
-	    version => PVE::Cluster::get_node_kv("ceph-version"),
-	};
+	my $res = {};
 
 	if (defined(my $versions = PVE::Ceph::Services::get_ceph_versions())) {
 	    $res->{node} = $versions;
-- 
2.30.2





More information about the pve-devel mailing list