mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-08-07 14:32:14 +00:00
tape inventory: code cleanup media pool look-up
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
6905bd3735
commit
7792507a12
@ -249,14 +249,11 @@ impl Inventory {
|
|||||||
///
|
///
|
||||||
/// Returns (pool, is_empty)
|
/// Returns (pool, is_empty)
|
||||||
pub fn lookup_media_pool(&self, uuid: &Uuid) -> Option<(&str, bool)> {
|
pub fn lookup_media_pool(&self, uuid: &Uuid) -> Option<(&str, bool)> {
|
||||||
match self.map.get(uuid) {
|
let pool = self.map.get(uuid)?;
|
||||||
None => None,
|
pool.id
|
||||||
Some(entry) => entry
|
.media_set_label
|
||||||
.id
|
.as_ref()
|
||||||
.media_set_label
|
.map(|media_set| (media_set.pool.as_str(), media_set.unassigned()))
|
||||||
.as_ref()
|
|
||||||
.map(|set| (set.pool.as_str(), set.unassigned())),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// List all media assigned to the pool
|
/// List all media assigned to the pool
|
||||||
|
Loading…
Reference in New Issue
Block a user