src/tools/disks/zfs.rs: make zfs list parser private

This commit is contained in:
Dietmar Maurer
2020-06-17 07:00:54 +02:00
parent c72ccd4e33
commit 66af7f51bc
2 changed files with 24 additions and 17 deletions

View File

@ -17,6 +17,7 @@ use proxmox::api::router::Router;
use crate::config::acl::{PRIV_SYS_AUDIT, PRIV_SYS_MODIFY};
use crate::tools::disks::{
zpool_list,
DiskUsageType,
};
@ -127,12 +128,7 @@ pub struct ZpoolListItem {
/// List zfs pools.
pub fn list_zpools() -> Result<Vec<ZpoolListItem>, Error> {
let mut command = std::process::Command::new("/sbin/zpool");
command.args(&["list", "-H", "-p", "-P"]);
let output = crate::tools::run_command(command, None)?;
let data = crate::tools::disks::parse_zfs_list(&output)?;
let data = zpool_list(None, false)?;
let mut list = Vec::new();