move datastore config to pbs_config workspace

This commit is contained in:
Dietmar Maurer
2021-09-10 08:40:58 +02:00
parent ba3d7e19fb
commit e7d4be9d85
24 changed files with 311 additions and 342 deletions

View File

@ -8,7 +8,7 @@ use proxmox::api::{
use proxmox::api::router::Router;
use pbs_api_types::{
Authid, ZpoolListItem, ZfsRaidLevel, ZfsCompressionType,
Authid, ZpoolListItem, ZfsRaidLevel, ZfsCompressionType, DataStoreConfig,
NODE_SCHEMA, ZPOOL_NAME_SCHEMA, DATASTORE_SCHEMA, DISK_ARRAY_SCHEMA,
DISK_LIST_SCHEMA, ZFS_ASHIFT_SCHEMA, UPID_SCHEMA,
PRIV_SYS_AUDIT, PRIV_SYS_MODIFY,
@ -18,7 +18,6 @@ use crate::tools::disks::{
zpool_list, zpool_status, parse_zpool_status_config_tree, vdev_list_to_tree,
DiskUsageType,
};
use crate::config::datastore::{self, DataStoreConfig};
use crate::server::WorkerTask;
@ -285,11 +284,11 @@ pub fn create_zpool(
}
if add_datastore {
let lock = datastore::lock_config()?;
let lock = pbs_config::datastore::lock_config()?;
let datastore: DataStoreConfig =
serde_json::from_value(json!({ "name": name, "path": mount_point }))?;
let (config, _digest) = datastore::config()?;
let (config, _digest) = pbs_config::datastore::config()?;
if config.sections.get(&datastore.name).is_some() {
bail!("datastore '{}' already exists.", datastore.name);