[pve-devel] [PATCH storage 1/3] CephConfig: do not always interpret '; ' as a comment

Dominik Csapak d.csapak at proxmox.com
Thu Jun 27 10:43:10 CEST 2019


; is the beginning of a comment, but in some configuration settings
it is also valid syntax, e.g. for mon_host it is a valid
seperator for hosts (sigh ...)

only remove lines when it starts with a ';'

since we remove all comments anyway any time we write the ceph conf
it should not really matter for our users

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/CephConfig.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/PVE/CephConfig.pm b/PVE/CephConfig.pm
index ab78328..3ff49ee 100644
--- a/PVE/CephConfig.pm
+++ b/PVE/CephConfig.pm
@@ -21,8 +21,9 @@ sub parse_ceph_config {
     my $section;
 
     foreach my $line (@lines) {
-	$line =~ s/[;#].*$//;
+	$line =~ s/#.*$//;
 	$line =~ s/^\s+//;
+	$line =~ s/^;.*$//;
 	$line =~ s/\s+$//;
 	next if !$line;
 
-- 
2.20.1





More information about the pve-devel mailing list