mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
better predicate to wait on for setup flow
This commit is contained in:
committed by
Aiden McClelland
parent
796e3300b9
commit
fa7748ebf9
@@ -47,18 +47,19 @@ pub async fn execute(
|
|||||||
let guid =
|
let guid =
|
||||||
crate::disk::main::create(&ctx.zfs_pool_name, [embassy_logicalname], DEFAULT_PASSWORD)
|
crate::disk::main::create(&ctx.zfs_pool_name, [embassy_logicalname], DEFAULT_PASSWORD)
|
||||||
.await?;
|
.await?;
|
||||||
|
let search_string = format!("id: {}", guid);
|
||||||
let mut ctr = 0;
|
let mut ctr = 0;
|
||||||
while {
|
while {
|
||||||
ctr += 1;
|
ctr += 1;
|
||||||
ctr < 30 // 30s timeout
|
ctr < 30 // 30s timeout
|
||||||
} && String::from_utf8(
|
} && !String::from_utf8(
|
||||||
Command::new("zpool")
|
Command::new("zpool")
|
||||||
.arg("import")
|
.arg("import")
|
||||||
.invoke(crate::ErrorKind::Zfs)
|
.invoke(crate::ErrorKind::Zfs)
|
||||||
.await?,
|
.await?,
|
||||||
)?
|
)?
|
||||||
.trim()
|
.lines()
|
||||||
== "no pools available to import"
|
.any(|line| line.trim() == &search_string)
|
||||||
{
|
{
|
||||||
tokio::time::sleep(Duration::from_secs(1)).await;
|
tokio::time::sleep(Duration::from_secs(1)).await;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user