[pve-devel] [PATCH manager 1/2] Ceph: add get_cluster_versions helper

Fabian Grünbichler f.gruenbichler at proxmox.com
Mon Jun 24 13:56:39 CEST 2019


to make 'ceph versions' and 'ceph XX versions' accessible.

Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
 PVE/Ceph/Tools.pm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/PVE/Ceph/Tools.pm b/PVE/Ceph/Tools.pm
index 617aba66..319e2ddd 100644
--- a/PVE/Ceph/Tools.pm
+++ b/PVE/Ceph/Tools.pm
@@ -61,6 +61,14 @@ sub get_local_version {
     return undef;
 }
 
+sub get_cluster_versions {
+    my ($service, $noerr) = @_;
+
+    my $rados = PVE::RADOS->new();
+    my $cmd = $service ? "$service versions" : 'versions';
+    return $rados->mon_command({ prefix => $cmd });
+}
+
 sub get_config {
     my $key = shift;
 
-- 
2.20.1





More information about the pve-devel mailing list