[mount] Bail on bad config

- One might argue whether an empty list of partitions to mount is
   a bad thing. It suggests that the partition module wasn't used,
   and so we're in an OEM situation -- but then everything should
   already be mounted anyway. That's why I choose empty -> bail.
main
Adriaan de Groot 6 years ago
parent ec0fe2ccd3
commit 7d0874e23b

@ -133,9 +133,15 @@ def run():
:return:
"""
root_mount_point = tempfile.mkdtemp(prefix="calamares-root-")
partitions = libcalamares.globalstorage.value("partitions")
if not partitions:
libcalamares.utils.warning("partitions is empty, {!s}".format(partitions))
return (_("Configuration Error"),
_("No partitions are defined for <pre>{!s}</pre> to use." ).format("mount"))
root_mount_point = tempfile.mkdtemp(prefix="calamares-root-")
# Guard against missing keys (generally a sign that the config file is bad)
extra_mounts = libcalamares.job.configuration.get("extraMounts") or []
extra_mounts_efi = libcalamares.job.configuration.get("extraMountsEfi") or []

Loading…
Cancel
Save