Add write_config, drop cfs_read_file

Use PVE::Storage::config() and the new
PVE::Storage::write_config() instead of cfs_read_file and
cfs_write_file with a hardcoded filename.
This commit is contained in:
Fabian Grünbichler
2016-03-25 15:07:24 +01:00
committed by Dietmar Maurer
parent 59ca7928cf
commit 83d7192ff9
4 changed files with 25 additions and 19 deletions

View File

@ -13,7 +13,7 @@ use Cwd 'abs_path';
use Socket;
use PVE::Tools qw(run_command file_read_firstline $IPV6RE);
use PVE::Cluster qw(cfs_read_file cfs_lock_file);
use PVE::Cluster qw(cfs_read_file cfs_write_file cfs_lock_file);
use PVE::Exception qw(raise_param_exc);
use PVE::JSONSchema;
use PVE::INotify;
@ -56,6 +56,12 @@ sub config {
return cfs_read_file("storage.cfg");
}
sub write_config {
my ($cfg) = @_;
cfs_write_file('storage.cfg', $cfg);
}
sub lock_storage_config {
my ($code, $errmsg) = @_;