tape: MediaPool::with_config() - remove name parameter
Not required, because config already contains the pool name.
This commit is contained in:
		@ -73,7 +73,7 @@ pub async fn list_media(pool: Option<String>) -> Result<Vec<MediaListEntry>, Err
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        let config: MediaPoolConfig = config.lookup("pool", pool_name)?;
 | 
					        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();
 | 
					        let current_time = proxmox::tools::time::epoch_i64();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -82,7 +82,6 @@ impl MediaPool {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    /// Creates a new instance using the media pool configuration
 | 
					    /// Creates a new instance using the media pool configuration
 | 
				
			||||||
    pub fn with_config(
 | 
					    pub fn with_config(
 | 
				
			||||||
        name: &str,
 | 
					 | 
				
			||||||
        state_path: &Path,
 | 
					        state_path: &Path,
 | 
				
			||||||
        config: &MediaPoolConfig,
 | 
					        config: &MediaPoolConfig,
 | 
				
			||||||
    ) -> Result<Self, Error> {
 | 
					    ) -> Result<Self, Error> {
 | 
				
			||||||
@ -91,7 +90,7 @@ impl MediaPool {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        let retention = config.retention.clone().unwrap_or(String::from("keep")).parse()?;
 | 
					        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
 | 
					    /// Returns the pool name
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user