datastore: add additional context for get_owner parsing error

By this it becomes clear that the error stems from a parsing error when
getting the backup group owner.

See also: https://forum.proxmox.com/threads/139482/

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
This commit is contained in:
Christian Ebner 2024-01-09 18:13:05 +01:00 committed by Wolfgang Bumiller
parent 2dd9f98fde
commit de6b0ea35a

View File

@ -602,7 +602,12 @@ impl DataStore {
) -> Result<Authid, Error> {
let full_path = self.owner_path(ns, backup_group);
let owner = proxmox_sys::fs::file_read_firstline(full_path)?;
owner.trim_end().parse() // remove trailing newline
owner
.trim_end() // remove trailing newline
.parse()
.map_err(|err| {
format_err!("parsing owner for {backup_group} failed: {err}")
})
}
pub fn owns_backup(