From 983921b9a19a2c45453e7a17e255ecba5d8c6fb0 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Tue, 21 Jun 2022 17:04:02 +0200 Subject: [PATCH] pveceph: factor out supported/default ceph version to single source Signed-off-by: Thomas Lamprecht --- PVE/CLI/pveceph.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/PVE/CLI/pveceph.pm b/PVE/CLI/pveceph.pm index 96b7a315..62763ad2 100755 --- a/PVE/CLI/pveceph.pm +++ b/PVE/CLI/pveceph.pm @@ -106,6 +106,9 @@ __PACKAGE__->register_method ({ return undef; }}); +my $supported_ceph_versions = ['octopus', 'pacific', 'quincy']; +my $default_ceph_version = 'pacific'; + __PACKAGE__->register_method ({ name => 'install', path => 'install', @@ -116,8 +119,8 @@ __PACKAGE__->register_method ({ properties => { version => { type => 'string', - enum => ['octopus', 'pacific', 'quincy'], - default => 'pacific', + enum => $supported_ceph_versions, + default => $default_ceph_version, description => "Ceph version to install.", optional => 1, }, @@ -139,7 +142,7 @@ __PACKAGE__->register_method ({ code => sub { my ($param) = @_; - my $cephver = $param->{version} || 'pacific'; # NOTE: always change default here too! + my $cephver = $param->{version} || $default_ceph_version; my $repo = $param->{'test-repository'} ? 'test' : 'main';