]> git.proxmox.com Git - pve-manager.git/commitdiff
pveceph: factor out supported/default ceph version to single source
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 21 Jun 2022 15:04:02 +0000 (17:04 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 21 Jun 2022 15:04:49 +0000 (17:04 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/CLI/pveceph.pm

index 96b7a315569e2801933cb1f81976bb5718d7fcaa..62763ad2c6bdac71787a2bbc1c4e240290f92642 100755 (executable)
@@ -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';