[unpackfs] Log messages in English, too

- For debugging purposes, need to log the message in English before
   returning the (user-visible) error description.
This commit is contained in:
Adriaan de Groot 2019-01-25 07:53:39 -05:00
parent 4004af09ad
commit 28efe2b85a

View File

@ -293,11 +293,13 @@ def run():
root_mount_point = globalstorage.value("rootMountPoint")
if not root_mount_point:
utils.warning("No mount point for root partition")
return (_("No mount point for root partition"),
_("globalstorage does not contain a \"rootMountPoint\" key, "
"doing nothing"))
if not os.path.exists(root_mount_point):
utils.warning("Bad root mount point \"{}\"".format(root_mount_point))
return (_("Bad mount point for root partition"),
_("rootMountPoint is \"{}\", which does not "
"exist, doing nothing").format(root_mount_point))
@ -311,16 +313,19 @@ def run():
sourcefs = entry["sourcefs"]
if sourcefs not in supported_filesystems:
utils.warning("The filesystem for \"{}\" ({}) is not supported".format(source, sourcefs))
return (_("Bad unsquash configuration"),
_("The filesystem for \"{}\" ({}) is not supported").format(source, sourcefs))
destination = os.path.abspath(root_mount_point + entry["destination"])
if not os.path.exists(source):
utils.warning("The source filesystem \"{}\" does not exist".format(source))
return (_("Bad unsquash configuration"),
_("The source filesystem \"{}\" does not exist").format(source))
if not os.path.isdir(destination):
utils.warning(("The destination \"{}\" in the target system is not a directory").format(destination))
return (_("Bad unsquash configuration"),
_("The destination \"{}\" in the target system is not a directory").format(destination))