datastore: backup info: drop deprecated list_backup_groups
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
7d9cb8c458
commit
693f3285eb
|
@ -5,8 +5,7 @@ use std::str::FromStr;
|
||||||
use anyhow::{bail, format_err, Error};
|
use anyhow::{bail, format_err, Error};
|
||||||
|
|
||||||
use pbs_api_types::{
|
use pbs_api_types::{
|
||||||
GroupFilter, BACKUP_DATE_REGEX, BACKUP_FILE_REGEX, BACKUP_ID_REGEX, BACKUP_TYPE_REGEX,
|
GroupFilter, BACKUP_DATE_REGEX, BACKUP_FILE_REGEX, GROUP_PATH_REGEX, SNAPSHOT_PATH_REGEX,
|
||||||
GROUP_PATH_REGEX, SNAPSHOT_PATH_REGEX,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::manifest::MANIFEST_BLOB_NAME;
|
use super::manifest::MANIFEST_BLOB_NAME;
|
||||||
|
@ -369,38 +368,6 @@ impl BackupInfo {
|
||||||
Ok(files)
|
Ok(files)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deprecated = "move to datastore"]
|
|
||||||
pub fn list_backup_groups(base_path: &Path) -> Result<Vec<BackupGroup>, Error> {
|
|
||||||
let mut list = Vec::new();
|
|
||||||
|
|
||||||
proxmox_sys::fs::scandir(
|
|
||||||
libc::AT_FDCWD,
|
|
||||||
base_path,
|
|
||||||
&BACKUP_TYPE_REGEX,
|
|
||||||
|l0_fd, backup_type, file_type| {
|
|
||||||
if file_type != nix::dir::Type::Directory {
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
proxmox_sys::fs::scandir(
|
|
||||||
l0_fd,
|
|
||||||
backup_type,
|
|
||||||
&BACKUP_ID_REGEX,
|
|
||||||
|_, backup_id, file_type| {
|
|
||||||
if file_type != nix::dir::Type::Directory {
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
|
|
||||||
list.push(BackupGroup::new(backup_type, backup_id));
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
},
|
|
||||||
)
|
|
||||||
},
|
|
||||||
)?;
|
|
||||||
|
|
||||||
Ok(list)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn is_finished(&self) -> bool {
|
pub fn is_finished(&self) -> bool {
|
||||||
// backup is considered unfinished if there is no manifest
|
// backup is considered unfinished if there is no manifest
|
||||||
self.files.iter().any(|name| name == MANIFEST_BLOB_NAME)
|
self.files.iter().any(|name| name == MANIFEST_BLOB_NAME)
|
||||||
|
|
Loading…
Reference in New Issue