move drive config to pbs_config workspace

Also moved the tape type definitions to pbs_api_types.
This commit is contained in:
Dietmar Maurer
2021-09-03 09:10:18 +02:00
parent ccb3b45e18
commit 1ce8e905ea
36 changed files with 323 additions and 357 deletions

View File

@ -11,6 +11,11 @@ use proxmox::{
},
};
use pbs_config::drive::{
complete_drive_name,
complete_changer_name,
};
use proxmox_backup::{
api2::{
self,
@ -20,16 +25,7 @@ use proxmox_backup::{
},
tape::{
complete_changer_path,
drive::{
media_changer,
},
},
config::{
self,
drive::{
complete_drive_name,
complete_changer_name,
}
drive::media_changer,
},
};
@ -232,7 +228,7 @@ async fn get_status(
rpcenv: &mut dyn RpcEnvironment,
) -> Result<(), Error> {
let (config, _digest) = config::drive::config()?;
let (config, _digest) = pbs_config::drive::config()?;
param["name"] = lookup_changer_name(&param, &config)?.into();
@ -295,7 +291,7 @@ pub async fn transfer(
rpcenv: &mut dyn RpcEnvironment,
) -> Result<(), Error> {
let (config, _digest) = config::drive::config()?;
let (config, _digest) = pbs_config::drive::config()?;
param["name"] = lookup_changer_name(&param, &config)?.into();

View File

@ -10,21 +10,16 @@ use proxmox::{
},
};
use proxmox_backup::{
api2::{
self,
types::{
DRIVE_NAME_SCHEMA,
},
},
tape::complete_drive_path,
config::drive::{
complete_drive_name,
complete_changer_name,
complete_lto_drive_name,
},
use pbs_api_types::DRIVE_NAME_SCHEMA;
use pbs_config::drive::{
complete_drive_name,
complete_changer_name,
complete_lto_drive_name,
};
use proxmox_backup::{api2, tape::complete_drive_path};
pub fn drive_commands() -> CommandLineInterface {
let cmd_def = CliCommandMap::new()

View File

@ -16,7 +16,6 @@ use pbs_datastore::Kdf;
use pbs_datastore::paperkey::{PaperkeyFormat, generate_paper_key};
use proxmox_backup::{
config,
api2::{
self,
types::{
@ -208,7 +207,7 @@ async fn restore_key(
rpcenv: &mut dyn RpcEnvironment,
) -> Result<(), Error> {
let (config, _digest) = config::drive::config()?;
let (config, _digest) = pbs_config::drive::config()?;
param["drive"] = crate::extract_drive_name(&mut param, &config)?.into();
if !tty::stdin_isatty() {

View File

@ -10,18 +10,14 @@ use proxmox::{
},
};
use pbs_api_types::{
MEDIA_POOL_NAME_SCHEMA, CHANGER_NAME_SCHEMA, MediaStatus, MediaListEntry,
MediaContentListFilter,
};
use pbs_config::drive::complete_changer_name;
use proxmox_backup::{
api2::{
self,
types::{
MEDIA_POOL_NAME_SCHEMA,
CHANGER_NAME_SCHEMA,
MediaStatus,
MediaListEntry,
},
tape::media::MediaContentListFilter,
},
config::drive::complete_changer_name,
api2,
tape::{
complete_media_label_text,
complete_media_uuid,