Skip to content

Commit 4334ff2

Browse files
authored
Merge pull request #303 from muesli4brekkies/patch-1
BUGFIX: Fix odd subshell behaviour if device is not first detected
2 parents 7d7c397 + 810361b commit 4334ff2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/ugrd/crypto/cryptsetup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -448,9 +448,6 @@ def get_crypt_dev(self) -> str:
448448
printf "%s" "$source_dev"
449449
fi
450450
fi
451-
if [ -z "$source_dev" ]; then
452-
rd_fail "Failed to find cryptsetup device: $1"
453-
fi
454451
"""
455452

456453

@@ -462,6 +459,10 @@ def open_crypt_dev(self) -> str:
462459
"""
463460
out = """
464461
crypt_device="$(get_crypt_dev "$1")"
462+
if [ -z "$crypt_device" ]; then
463+
rd_fail "Failed to find cryptsetup device: $1"
464+
fi
465+
465466
header="$(readvar CRYPTSETUP_HEADER_"$1")"
466467
467468
cryptsetup_args="cryptsetup open --tries 1"

0 commit comments

Comments
 (0)