mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-10-04 20:16:38 +00:00
proxmox-tape: inventory: add default to parameters
and convert the 'Option<bool>' to 'bool' Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
57ee4e9ea4
commit
f963bc0c81
@ -438,11 +438,13 @@ async fn read_label(mut param: Value) -> Result<(), Error> {
|
|||||||
description: "Load unknown tapes and try read labels",
|
description: "Load unknown tapes and try read labels",
|
||||||
type: bool,
|
type: bool,
|
||||||
optional: true,
|
optional: true,
|
||||||
|
default: false,
|
||||||
},
|
},
|
||||||
"read-all-labels": {
|
"read-all-labels": {
|
||||||
description: "Load all tapes and try read labels (even if already inventoried)",
|
description: "Load all tapes and try read labels (even if already inventoried)",
|
||||||
type: bool,
|
type: bool,
|
||||||
optional: true,
|
optional: true,
|
||||||
|
default: false,
|
||||||
},
|
},
|
||||||
"catalog": {
|
"catalog": {
|
||||||
description: "Try to restore catalogs from tapes.",
|
description: "Try to restore catalogs from tapes.",
|
||||||
@ -455,8 +457,8 @@ async fn read_label(mut param: Value) -> Result<(), Error> {
|
|||||||
)]
|
)]
|
||||||
/// List (and update) media labels (Changer Inventory)
|
/// List (and update) media labels (Changer Inventory)
|
||||||
async fn inventory(
|
async fn inventory(
|
||||||
read_labels: Option<bool>,
|
read_labels: bool,
|
||||||
read_all_labels: Option<bool>,
|
read_all_labels: bool,
|
||||||
catalog: bool,
|
catalog: bool,
|
||||||
mut param: Value,
|
mut param: Value,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
@ -465,8 +467,7 @@ async fn inventory(
|
|||||||
let (config, _digest) = pbs_config::drive::config()?;
|
let (config, _digest) = pbs_config::drive::config()?;
|
||||||
let drive = extract_drive_name(&mut param, &config)?;
|
let drive = extract_drive_name(&mut param, &config)?;
|
||||||
|
|
||||||
let read_all_labels = read_all_labels.unwrap_or(false);
|
let do_read = read_labels || read_all_labels || catalog;
|
||||||
let do_read = read_labels.unwrap_or(false) || read_all_labels || catalog;
|
|
||||||
|
|
||||||
let client = connect_to_localhost()?;
|
let client = connect_to_localhost()?;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user