check_chroot_call does not actually return a error code, use chroot_call

instead.

Thanks to Kevin Kofler for pointing this out.
This commit is contained in:
Rohan Garg 2014-11-12 18:54:26 +01:00
parent 1f6feb9417
commit d9187c25c7
2 changed files with 5 additions and 7 deletions

View File

@ -19,14 +19,12 @@
# along with Calamares. If not, see <http://www.gnu.org/licenses/>. # along with Calamares. If not, see <http://www.gnu.org/licenses/>.
import libcalamares import libcalamares
from libcalamares.utils import check_chroot_call from libcalamares.utils import chroot_call
def run_dracut(): def run_dracut():
return check_chroot_call(['dracut', '-f']) return chroot_call(['dracut', '-f'])
def run(): def run():
returnCode = run_dracut() returnCode = run_dracut()
if returnCode != 0: if returnCode != 0:
return ("Failed to run dracut on the target", "The exit code was {}".format(returnCode)) return ("Failed to run dracut on the target", "The exit code was {}".format(returnCode))

View File

@ -17,9 +17,9 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Calamares. If not, see <http://www.gnu.org/licenses/>. # along with Calamares. If not, see <http://www.gnu.org/licenses/>.
from libcalamares.utils import check_chroot_call from libcalamares.utils import chroot_call
def run(): def run():
returnCode = check_chroot_call(["update-initramfs", "-k", "all", "-u"]) returnCode = chroot_call(["update-initramfs", "-k", "all", "-u"])
if returnCode != 0: if returnCode != 0:
return ("Failed to run update-initramfs on the target", "The exit code was {}".format(returnCode)) return ("Failed to run update-initramfs on the target", "The exit code was {}".format(returnCode))