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:
committed by
Dietmar Maurer
parent
59ca7928cf
commit
83d7192ff9
@ -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) = @_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user