all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager 1/2] api: ceph: fix getting ceph versions
Date: Wed, 10 Nov 2021 13:15:55 +0100	[thread overview]
Message-ID: <20211110121556.500448-2-d.csapak@proxmox.com> (raw)
In-Reply-To: <20211110121556.500448-1-d.csapak@proxmox.com>

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@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





  reply	other threads:[~2021-11-10 12:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-10 12:15 [pve-devel] [PATCH manager 0/2] fix ceph version handling in gui Dominik Csapak
2021-11-10 12:15 ` Dominik Csapak [this message]
2021-11-10 12:15 ` [pve-devel] [PATCH manager 2/2] ui: ceph: fix version handling Dominik Csapak
2021-11-10 12:58 ` [pve-devel] [PATCH manager 0/2] fix ceph version handling in gui Thomas Lamprecht
2021-11-10 13:40 ` [pve-devel] applied-series: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211110121556.500448-2-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal