From 1f6feb94170de419158e2503ca178918666c4151 Mon Sep 17 00:00:00 2001 From: Rohan Garg Date: Wed, 12 Nov 2014 17:04:28 +0100 Subject: [PATCH] Make sure we return a message when dracut or initramfs fail --- src/modules/dracut/main.py | 9 ++++++--- src/modules/initramfs/main.py | 5 +++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/modules/dracut/main.py b/src/modules/dracut/main.py index 3e1a2867d..7fc59baf3 100644 --- a/src/modules/dracut/main.py +++ b/src/modules/dracut/main.py @@ -22,8 +22,11 @@ import libcalamares from libcalamares.utils import check_chroot_call def run_dracut(): - check_chroot_call(['dracut', '-f']) + return check_chroot_call(['dracut', '-f']) def run(): - run_dracut() - return None + returnCode = run_dracut() + if returnCode != 0: + return ("Failed to run dracut on the target", "The exit code was {}".format(returnCode)) + + diff --git a/src/modules/initramfs/main.py b/src/modules/initramfs/main.py index 28ef8617b..058bf2e30 100644 --- a/src/modules/initramfs/main.py +++ b/src/modules/initramfs/main.py @@ -20,5 +20,6 @@ from libcalamares.utils import check_chroot_call def run(): - check_chroot_call(["update-initramfs", "-k", "all", "-u"]) - return None + returnCode = check_chroot_call(["update-initramfs", "-k", "all", "-u"]) + if returnCode != 0: + return ("Failed to run update-initramfs on the target", "The exit code was {}".format(returnCode))