mirror of
				https://git.proxmox.com/git/proxmox-backup
				synced 2025-11-02 15:18:42 +00:00 
			
		
		
		
	clippy: avoid useless format!
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
		
							parent
							
								
									38556bf60d
								
							
						
					
					
						commit
						3b82f3eea5
					
				@ -730,7 +730,7 @@ pub fn update_inventory(
 | 
			
		||||
 | 
			
		||||
            let label_text_list = changer.online_media_label_texts()?;
 | 
			
		||||
            if label_text_list.is_empty() {
 | 
			
		||||
                worker.log(format!("changer device does not list any media labels"));
 | 
			
		||||
                worker.log("changer device does not list any media labels".to_string());
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            let state_path = Path::new(TAPE_STATUS_DIR);
 | 
			
		||||
 | 
			
		||||
@ -389,7 +389,7 @@ fn restore_chunk_archive<'a>(
 | 
			
		||||
 | 
			
		||||
            // check if this is an aborted stream without end marker
 | 
			
		||||
            if let Ok(false) = reader.has_end_marker() {
 | 
			
		||||
                worker.log(format!("missing stream end marker"));
 | 
			
		||||
                worker.log("missing stream end marker".to_string());
 | 
			
		||||
                return Ok(None);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -581,16 +581,16 @@ async fn schedule_task_log_rotate() {
 | 
			
		||||
        false,
 | 
			
		||||
        move |worker| {
 | 
			
		||||
            job.start(&worker.upid().to_string())?;
 | 
			
		||||
            worker.log(format!("starting task log rotation"));
 | 
			
		||||
            worker.log("starting task log rotation".to_string());
 | 
			
		||||
 | 
			
		||||
            let result = try_block!({
 | 
			
		||||
                let max_size = 512 * 1024 - 1; // an entry has ~ 100b, so > 5000 entries/file
 | 
			
		||||
                let max_files = 20; // times twenty files gives > 100000 task entries
 | 
			
		||||
                let has_rotated = rotate_task_log_archive(max_size, true, Some(max_files))?;
 | 
			
		||||
                if has_rotated {
 | 
			
		||||
                    worker.log(format!("task log archive was rotated"));
 | 
			
		||||
                    worker.log("task log archive was rotated".to_string());
 | 
			
		||||
                } else {
 | 
			
		||||
                    worker.log(format!("task log archive was not rotated"));
 | 
			
		||||
                    worker.log("task log archive was not rotated".to_string());
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                let max_size = 32 * 1024 * 1024 - 1;
 | 
			
		||||
@ -601,18 +601,18 @@ async fn schedule_task_log_rotate() {
 | 
			
		||||
                if logrotate.rotate(max_size, None, Some(max_files))? {
 | 
			
		||||
                    println!("rotated access log, telling daemons to re-open log file");
 | 
			
		||||
                    proxmox_backup::tools::runtime::block_on(command_reopen_logfiles())?;
 | 
			
		||||
                    worker.log(format!("API access log was rotated"));
 | 
			
		||||
                    worker.log("API access log was rotated".to_string());
 | 
			
		||||
                } else {
 | 
			
		||||
                    worker.log(format!("API access log was not rotated"));
 | 
			
		||||
                    worker.log("API access log was not rotated".to_string());
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                let mut logrotate = LogRotate::new(buildcfg::API_AUTH_LOG_FN, true)
 | 
			
		||||
                        .ok_or_else(|| format_err!("could not get API auth log file names"))?;
 | 
			
		||||
 | 
			
		||||
                if logrotate.rotate(max_size, None, Some(max_files))? {
 | 
			
		||||
                    worker.log(format!("API authentication log was rotated"));
 | 
			
		||||
                    worker.log("API authentication log was rotated".to_string());
 | 
			
		||||
                } else {
 | 
			
		||||
                    worker.log(format!("API authentication log was not rotated"));
 | 
			
		||||
                    worker.log("API authentication log was not rotated".to_string());
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                Ok(())
 | 
			
		||||
 | 
			
		||||
@ -391,7 +391,7 @@ pub fn request_and_load_media(
 | 
			
		||||
                            }
 | 
			
		||||
                            Ok((None, _)) => {
 | 
			
		||||
                                if last_media_uuid.is_some() {
 | 
			
		||||
                                    worker.log(format!("found empty media without label (please label all tapes first)"));
 | 
			
		||||
                                    worker.log("found empty media without label (please label all tapes first)".to_string());
 | 
			
		||||
                                    last_media_uuid = None;
 | 
			
		||||
                                }
 | 
			
		||||
                            }
 | 
			
		||||
 | 
			
		||||
@ -426,7 +426,7 @@ fn write_chunk_archive<'a>(
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if writer.bytes_written() > max_size {
 | 
			
		||||
            worker.log(format!("Chunk Archive max size reached, closing archive"));
 | 
			
		||||
            worker.log("Chunk Archive max size reached, closing archive".to_string());
 | 
			
		||||
            break;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
@ -472,7 +472,7 @@ fn update_media_set_label(
 | 
			
		||||
 | 
			
		||||
    match old_set {
 | 
			
		||||
        None => {
 | 
			
		||||
            worker.log(format!("wrinting new media set label"));
 | 
			
		||||
            worker.log("wrinting new media set label".to_string());
 | 
			
		||||
            drive.write_media_set_label(new_set, key_config.as_ref())?;
 | 
			
		||||
            media_catalog = MediaCatalog::overwrite(status_path, media_id, false)?;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user