replace deprecated list_backup_group from BackupInfo with Datastore one

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht
2022-04-15 10:50:28 +02:00
parent c90dbb5c7b
commit 7d9cb8c458
5 changed files with 71 additions and 78 deletions

View File

@ -6,7 +6,6 @@ use proxmox_sys::{task_log, task_warn};
use pbs_api_types::{Authid, Operation, PruneOptions, PRIV_DATASTORE_MODIFY};
use pbs_config::CachedUserInfo;
use pbs_datastore::backup_info::BackupInfo;
use pbs_datastore::prune::compute_prune_info;
use pbs_datastore::DataStore;
use proxmox_rest_server::WorkerTask;
@ -43,11 +42,8 @@ pub fn prune_datastore(
let privs = user_info.lookup_privs(&auth_id, &["datastore", store]);
let has_privs = privs & PRIV_DATASTORE_MODIFY != 0;
let base_path = datastore.base_path();
let groups = BackupInfo::list_backup_groups(&base_path)?;
for group in groups {
let list = group.list_backups(&base_path)?;
for group in datastore.list_backup_groups()? {
let list = group.list_backups(&datastore.base_path())?;
if !has_privs && !datastore.owns_backup(&group, &auth_id)? {
continue;

View File

@ -28,7 +28,7 @@ use pbs_datastore::index::IndexFile;
use pbs_datastore::manifest::{
archive_type, ArchiveType, BackupManifest, FileInfo, CLIENT_LOG_BLOB_NAME, MANIFEST_BLOB_NAME,
};
use pbs_datastore::{BackupDir, BackupGroup, BackupInfo, DataStore, StoreProgress};
use pbs_datastore::{BackupDir, BackupGroup, DataStore, StoreProgress};
use pbs_tools::sha::sha256;
use proxmox_rest_server::WorkerTask;
@ -797,8 +797,7 @@ pub async fn pull_store(
if params.remove_vanished {
let result: Result<(), Error> = proxmox_lang::try_block!({
let local_groups = BackupInfo::list_backup_groups(&params.store.base_path())?;
for local_group in local_groups {
for local_group in params.store.list_backup_groups()? {
if new_groups.contains(&local_group) {
continue;
}