From 428872eb71f2d7f422d6b3413544b5d35fbb3a24 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Tue, 26 Apr 2022 12:47:54 +0200 Subject: [PATCH] ceph config: minor code cleanup & comment Signed-off-by: Thomas Lamprecht --- PVE/CephConfig.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/PVE/CephConfig.pm b/PVE/CephConfig.pm index c388f02..6b10d46 100644 --- a/PVE/CephConfig.pm +++ b/PVE/CephConfig.pm @@ -178,21 +178,20 @@ sub ceph_connect_option { my ($scfg, $storeid, %options) = @_; my $cmd_option = {}; - my $ceph_storeid_conf = "/etc/pve/priv/ceph/${storeid}.conf"; - my $pveceph_config = '/etc/pve/ceph.conf'; my $keyfile = "/etc/pve/priv/ceph/${storeid}.keyring"; $keyfile = "/etc/pve/priv/ceph/${storeid}.secret" if ($scfg->{type} eq 'cephfs'); my $pveceph_managed = !defined($scfg->{monhost}); - $cmd_option->{ceph_conf} = $pveceph_config if $pveceph_managed; + $cmd_option->{ceph_conf} = '/etc/pve/ceph.conf' if $pveceph_managed; $ceph_check_keyfile->($keyfile, $scfg->{type}); - if (-e $ceph_storeid_conf) { + if (-e "/etc/pve/priv/ceph/${storeid}.conf") { + # allow custom ceph configuration for external clusters if ($pveceph_managed) { warn "ignoring custom ceph config for storage '$storeid', 'monhost' is not set (assuming pveceph managed cluster)!\n"; } else { - $cmd_option->{ceph_conf} = $ceph_storeid_conf; + $cmd_option->{ceph_conf} = "/etc/pve/priv/ceph/${storeid}.conf"; } }