3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #48546 from andrew-d/andrew/hide-zfs-import-warning

nixos/zfs: Hide useless errors when waiting for zpool to be ready
This commit is contained in:
Sarah Brofeldt 2018-10-19 10:07:09 +02:00 committed by GitHub
commit 58717759b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -74,7 +74,7 @@ let
importLib = {zpoolCmd, awkCmd, cfgZfs}: ''
poolReady() {
pool="$1"
state="$("${zpoolCmd}" import | "${awkCmd}" "/pool: $pool/ { found = 1 }; /state:/ { if (found == 1) { print \$2; exit } }; END { if (found == 0) { print \"MISSING\" } }")"
state="$("${zpoolCmd}" import 2>/dev/null | "${awkCmd}" "/pool: $pool/ { found = 1 }; /state:/ { if (found == 1) { print \$2; exit } }; END { if (found == 0) { print \"MISSING\" } }")"
if [[ "$state" = "ONLINE" ]]; then
return 0
else