mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-13 03:55:06 +00:00
isert section when writing ceph.conf
This commit is contained in:
parent
570278fab0
commit
e9ea467759
@ -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);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user