ceph: init: lock ceph config

so that not multiple users can create a ceph cluster at the same time

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2019-06-18 15:42:47 +02:00 committed by Thomas Lamprecht
parent b3d8b5f527
commit 3e4c0f06e7

View File

@ -303,6 +303,7 @@ __PACKAGE__->register_method ({
} }
# simply load old config if it already exists # simply load old config if it already exists
PVE::Cluster::cfs_lock_file('ceph.conf', undef, sub {
my $cfg = cfs_read_file('ceph.conf'); my $cfg = cfs_read_file('ceph.conf');
if (!$cfg->{global}) { if (!$cfg->{global}) {
@ -349,6 +350,7 @@ __PACKAGE__->register_method ({
cfs_write_file('ceph.conf', $cfg); cfs_write_file('ceph.conf', $cfg);
PVE::Ceph::Tools::setup_pve_symlinks(); PVE::Ceph::Tools::setup_pve_symlinks();
});
return undef; return undef;
}}); }});