mirror of
https://git.proxmox.com/git/proxmox
synced 2025-07-25 20:57:04 +00:00
BackupNamespace: fix deserialize of root NS
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
e2cf8920ea
commit
1b3a49c595
@ -484,6 +484,11 @@ impl BackupNamespace {
|
|||||||
/// Try to parse a string into a namespace.
|
/// Try to parse a string into a namespace.
|
||||||
pub fn new(name: &str) -> Result<Self, Error> {
|
pub fn new(name: &str) -> Result<Self, Error> {
|
||||||
let mut this = Self::root();
|
let mut this = Self::root();
|
||||||
|
|
||||||
|
if name.is_empty() {
|
||||||
|
return Ok(this);
|
||||||
|
}
|
||||||
|
|
||||||
for name in name.split('/') {
|
for name in name.split('/') {
|
||||||
this.push(name.to_string())?;
|
this.push(name.to_string())?;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user