all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup v3 5/5] proxmox-tape: inventory: add default to parameters
Date: Wed, 19 Oct 2022 13:13:35 +0200	[thread overview]
Message-ID: <20221019111335.872853-6-d.csapak@proxmox.com> (raw)
In-Reply-To: <20221019111335.872853-1-d.csapak@proxmox.com>

and convert the 'Option<bool>' to 'bool'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 src/bin/proxmox-tape.rs | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/bin/proxmox-tape.rs b/src/bin/proxmox-tape.rs
index 3511507f..59254540 100644
--- a/src/bin/proxmox-tape.rs
+++ b/src/bin/proxmox-tape.rs
@@ -438,11 +438,13 @@ async fn read_label(mut param: Value) -> Result<(), Error> {
                 description: "Load unknown tapes and try read labels",
                 type: bool,
                 optional: true,
+                default: false,
             },
             "read-all-labels": {
                 description: "Load all tapes and try read labels (even if already inventoried)",
                 type: bool,
                 optional: true,
+                default: false,
             },
             "catalog": {
                 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)
 async fn inventory(
-    read_labels: Option<bool>,
-    read_all_labels: Option<bool>,
+    read_labels: bool,
+    read_all_labels: bool,
     catalog: bool,
     mut param: Value,
 ) -> Result<(), Error> {
@@ -465,8 +467,7 @@ async fn inventory(
     let (config, _digest) = pbs_config::drive::config()?;
     let drive = extract_drive_name(&mut param, &config)?;
 
-    let read_all_labels = read_all_labels.unwrap_or(false);
-    let do_read = read_labels.unwrap_or(false) || read_all_labels || catalog;
+    let do_read = read_labels || read_all_labels || catalog;
 
     let client = connect_to_localhost()?;
 
-- 
2.30.2





  parent reply	other threads:[~2022-10-19 11:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19 11:13 [pbs-devel] [PATCH proxmox-backup v3 0/5] allow restoring catalogs during inventory Dominik Csapak
2022-10-19 11:13 ` [pbs-devel] [PATCH proxmox-backup v3 1/5] tape: replace '&Path' with 'AsRef<Path>' in function parameters Dominik Csapak
2022-10-19 11:13 ` [pbs-devel] [PATCH proxmox-backup v3 2/5] api/tape/inventory: optionally try to restore catalogs Dominik Csapak
2022-10-19 11:13 ` [pbs-devel] [PATCH proxmox-backup v3 3/5] proxmox-tape: add 'catalog' option to 'proxmox-tape inventory' Dominik Csapak
2022-10-19 11:13 ` [pbs-devel] [PATCH proxmox-backup v3 4/5] ui: tape/ChangerStatus: adding parameter selection to inventory Dominik Csapak
2022-10-19 11:13 ` Dominik Csapak [this message]
2022-10-20 11:24 ` [pbs-devel] applied-series: [PATCH proxmox-backup v3 0/5] allow restoring catalogs during inventory Wolfgang Bumiller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221019111335.872853-6-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal