From 7c3aa258f85d6b193304d89bb295c0dbd5fa94cc Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Mon, 8 Jun 2020 07:23:04 +0200 Subject: [PATCH] src/tools/disks/zfs.rs: allow empty zpool list output --- src/tools/disks/zfs.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tools/disks/zfs.rs b/src/tools/disks/zfs.rs index fd23ba19..e5d61fe4 100644 --- a/src/tools/disks/zfs.rs +++ b/src/tools/disks/zfs.rs @@ -153,6 +153,9 @@ fn parse_pool_status(i: &str) -> IResult<&str, ZFSPoolStatus> { /// Note: This does not reveal any details on how the pool uses the devices, because /// the zpool list output format is not really defined... pub fn parse_zfs_list(i: &str) -> Result, Error> { + if i.is_empty() { + return Ok(Vec::new()); + } match all_consuming(many1(parse_pool_status))(i) { Err(nom::Err::Error(err)) | Err(nom::Err::Failure(err)) => {