From 2afdc7f27df94ac2622f601b4f776393ec0dadab Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Fri, 18 Dec 2020 08:14:24 +0100 Subject: [PATCH] tape: MediaPool::with_config() - remove name parameter Not required, because config already contains the pool name. --- src/api2/tape/media.rs | 2 +- src/tape/media_pool.rs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/api2/tape/media.rs b/src/api2/tape/media.rs index a8023676..e16477c5 100644 --- a/src/api2/tape/media.rs +++ b/src/api2/tape/media.rs @@ -73,7 +73,7 @@ pub async fn list_media(pool: Option) -> Result, Err let config: MediaPoolConfig = config.lookup("pool", pool_name)?; - let pool = MediaPool::with_config(pool_name, status_path, &config)?; + let pool = MediaPool::with_config(status_path, &config)?; let current_time = proxmox::tools::time::epoch_i64(); diff --git a/src/tape/media_pool.rs b/src/tape/media_pool.rs index 543ed3a3..b4a11e77 100644 --- a/src/tape/media_pool.rs +++ b/src/tape/media_pool.rs @@ -82,7 +82,6 @@ impl MediaPool { /// Creates a new instance using the media pool configuration pub fn with_config( - name: &str, state_path: &Path, config: &MediaPoolConfig, ) -> Result { @@ -91,7 +90,7 @@ impl MediaPool { let retention = config.retention.clone().unwrap_or(String::from("keep")).parse()?; - MediaPool::new(name, state_path, allocation, retention) + MediaPool::new(&config.name, state_path, allocation, retention) } /// Returns the pool name