tape: remove unused eject_on_unload method
This commit is contained in:
		@ -300,10 +300,6 @@ pub async fn eject_media(drive: String) -> Result<(), Error> {
 | 
			
		||||
 | 
			
		||||
    tokio::task::spawn_blocking(move || {
 | 
			
		||||
        if let Some((mut changer, _)) = media_changer(&config, &drive)? {
 | 
			
		||||
            if !changer.eject_on_unload() {
 | 
			
		||||
                let mut drive = open_drive(&config, &drive)?;
 | 
			
		||||
                drive.eject_media()?;
 | 
			
		||||
            }
 | 
			
		||||
            changer.unload_media(None)?;
 | 
			
		||||
        } else {
 | 
			
		||||
            let mut drive = open_drive(&config, &drive)?;
 | 
			
		||||
 | 
			
		||||
@ -94,16 +94,9 @@ pub trait MediaChange {
 | 
			
		||||
        self.load_media_from_slot(slot as u64)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /// Unload media from drive
 | 
			
		||||
    ///
 | 
			
		||||
    /// This is a nop on drives without autoloader.
 | 
			
		||||
    /// Unload media from drive (eject media if necessary)
 | 
			
		||||
    fn unload_media(&mut self, target_slot: Option<u64>) -> Result<(), Error>;
 | 
			
		||||
 | 
			
		||||
    /// Returns true if unload_media automatically ejects drive media
 | 
			
		||||
    fn eject_on_unload(&self) -> bool {
 | 
			
		||||
        false
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /// List online media changer IDs (barcodes)
 | 
			
		||||
    ///
 | 
			
		||||
    /// List acessible (online) changer IDs. This does not include
 | 
			
		||||
 | 
			
		||||
@ -69,8 +69,4 @@ impl MediaChange for MtxMediaChanger {
 | 
			
		||||
            self.unload_to_free_slot(status)
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    fn eject_on_unload(&self) -> bool {
 | 
			
		||||
        true
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -454,10 +454,6 @@ impl MediaChange for VirtualTapeHandle {
 | 
			
		||||
        Ok(())
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    fn eject_on_unload(&self) -> bool {
 | 
			
		||||
        true
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    fn clean_drive(&mut self) -> Result<(), Error> {
 | 
			
		||||
        Ok(())
 | 
			
		||||
    }
 | 
			
		||||
@ -504,10 +500,6 @@ impl MediaChange for VirtualTapeDrive {
 | 
			
		||||
        Ok(())
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    fn eject_on_unload(&self) -> bool {
 | 
			
		||||
        true
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    fn online_media_changer_ids(&mut self) -> Result<Vec<String>, Error> {
 | 
			
		||||
        let handle = self.open()?;
 | 
			
		||||
        handle.online_media_changer_ids()
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user