tools/osbuild-image-info: fail early if fstab isn't found
When the fstab file isn't found, the root_tree will never be set after being initialised to "" and an exception is raised "The root filesystem tree is not mounted". It's a lot clearer if the failure happens closer to the root cause, which is that fstab wasn't found and there are no fstab entries to iterate through and find the root filesystem.
This commit is contained in:
parent
dc047513b7
commit
10029167db
1 changed files with 3 additions and 0 deletions
|
|
@ -2630,6 +2630,9 @@ def append_partitions(report, image):
|
|||
if os.path.exists(f"{tree}/etc/fstab"):
|
||||
fstab.extend(read_fstab(tree))
|
||||
break
|
||||
else:
|
||||
raise RuntimeError("no fstab file found")
|
||||
|
||||
# sort the fstab entries by the mountpoint
|
||||
fstab = sorted(fstab, key=operator.itemgetter(1))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue