Fix exit code handling of e2fsck

This commit is contained in:
jld3103 2021-10-01 12:32:44 +02:00
parent c0f7a4ba63
commit acf59d35e8

View file

@ -17,7 +17,9 @@ def resize_fs(image_path: str, shrink: bool = False):
'-fy',
image_path,
])
if result.returncode != 0:
# https://man7.org/linux/man-pages/man8/e2fsck.8.html#EXIT_CODE
if result.returncode > 2:
print(result.returncode)
msg = f'Failed to e2fsck {image_path}'
if shrink:
raise Exception(msg)