tree-wide: prefer api-type BackupGroup for logging

together with DatastoreWithNamespace where needed, to not forget
namespace information.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler
2022-05-16 11:00:30 +02:00
committed by Thomas Lamprecht
parent eefa297aa0
commit e13303fca6
5 changed files with 58 additions and 32 deletions

View File

@ -9,8 +9,8 @@ use anyhow::{bail, format_err, Error};
use proxmox_sys::{task_log, WorkerTaskContext};
use pbs_api_types::{
print_ns_and_snapshot, Authid, BackupNamespace, BackupType, CryptMode, SnapshotVerifyState,
VerifyState, UPID,
print_ns_and_snapshot, Authid, BackupNamespace, BackupType, CryptMode, DatastoreWithNamespace,
SnapshotVerifyState, VerifyState, UPID,
};
use pbs_datastore::backup_info::{BackupDir, BackupGroup, BackupInfo};
use pbs_datastore::index::IndexFile;
@ -453,11 +453,15 @@ pub fn verify_backup_group(
let mut list = match group.list_backups() {
Ok(list) => list,
Err(err) => {
let store_with_ns = DatastoreWithNamespace {
store: verify_worker.datastore.name().to_owned(),
ns: group.backup_ns().clone(),
};
task_log!(
verify_worker.worker,
"verify group {}:{} - unable to list backups: {}",
verify_worker.datastore.name(),
group,
"verify {}, group {} - unable to list backups: {}",
store_with_ns,
group.group(),
err,
);
return Ok(errors);
@ -469,7 +473,7 @@ pub fn verify_backup_group(
verify_worker.worker,
"verify group {}:{} ({} snapshots)",
verify_worker.datastore.name(),
group,
group.group(),
snapshot_count
);