Commit 69ba82e9 authored by Dietmar Maurer's avatar Dietmar Maurer

isert section when writing ceph.conf

parent 7a48c7b7
...@@ -205,13 +205,25 @@ my $write_ceph_config = sub { ...@@ -205,13 +205,25 @@ my $write_ceph_config = sub {
my ($cfg) = @_; my ($cfg) = @_;
my $out = ''; my $out = '';
my $cond_write_sec = sub {
my $re = shift;
foreach my $section (keys %$cfg) { foreach my $section (keys %$cfg) {
next if $section !~ m/^$re$/;
$out .= "[$section]\n"; $out .= "[$section]\n";
foreach my $key (sort keys %{$cfg->{$section}}) { foreach my $key (sort keys %{$cfg->{$section}}) {
$out .= "\t $key = $cfg->{$section}->{$key}\n"; $out .= "\t $key = $cfg->{$section}->{$key}\n";
} }
$out .= "\n"; $out .= "\n";
} }
};
&$cond_write_sec('global');
&$cond_write_sec('mon');
&$cond_write_sec('osd');
&$cond_write_sec('mon\..*');
&$cond_write_sec('osd\..*');
PVE::Tools::file_set_contents($pve_ceph_cfgpath, $out); PVE::Tools::file_set_contents($pve_ceph_cfgpath, $out);
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment