[unpackfs] Still raise if mount fails

This commit is contained in:
Adriaan de Groot 2019-06-20 16:58:13 +02:00
parent 1b91f831bf
commit c14239ca30

View File

@ -244,17 +244,23 @@ class UnpackOperation:
def mount_image(self, entry, imgmountdir): def mount_image(self, entry, imgmountdir):
""" """
Mount given image as loop device. Mount given @p entry as loop device on @p imgmountdir.
:param entry: :param entry: the entry to mount (source is the important property)
:param imgmountdir: :param imgmountdir: where to mount it
:returns: None, but throws if the mount failed
""" """
if os.path.isdir(entry.source): if os.path.isdir(entry.source):
libcalamares.utils.mount(entry.source, imgmountdir, "", "--bind") r = libcalamares.utils.mount(entry.source, imgmountdir, "", "--bind")
elif os.path.isfile(entry.source): elif os.path.isfile(entry.source):
libcalamares.utils.mount(entry.source, imgmountdir, entry.sourcefs, "loop") r = libcalamares.utils.mount(entry.source, imgmountdir, entry.sourcefs, "loop")
else: # entry.source is a device else: # entry.source is a device
libcalamares.utils.mount(entry.source, imgmountdir, entry.sourcefs, "") r = libcalamares.utils.mount(entry.source, imgmountdir, entry.sourcefs, "")
if r != 0:
raise subprocess.CalledProcessError(r, "mount")
def unpack_image(self, entry, imgmountdir): def unpack_image(self, entry, imgmountdir):
""" """