From fa7748ebf992d5fe97e05af6a472da51733054b8 Mon Sep 17 00:00:00 2001 From: Aiden McClelland Date: Tue, 28 Sep 2021 16:21:27 -0600 Subject: [PATCH] better predicate to wait on for setup flow --- appmgr/src/setup.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/appmgr/src/setup.rs b/appmgr/src/setup.rs index 312593945..bc1f594c9 100644 --- a/appmgr/src/setup.rs +++ b/appmgr/src/setup.rs @@ -47,18 +47,19 @@ pub async fn execute( let guid = crate::disk::main::create(&ctx.zfs_pool_name, [embassy_logicalname], DEFAULT_PASSWORD) .await?; + let search_string = format!("id: {}", guid); let mut ctr = 0; while { ctr += 1; ctr < 30 // 30s timeout - } && String::from_utf8( + } && !String::from_utf8( Command::new("zpool") .arg("import") .invoke(crate::ErrorKind::Zfs) .await?, )? - .trim() - == "no pools available to import" + .lines() + .any(|line| line.trim() == &search_string) { tokio::time::sleep(Duration::from_secs(1)).await; }