Exit if installing grub fails
authorMichael Prokop <mika@grml.org>
Mon, 4 May 2009 20:27:27 +0000 (22:27 +0200)
committerMichael Prokop <mika@grml.org>
Mon, 4 May 2009 20:27:27 +0000 (22:27 +0200)
grml2usb

index 2c28990..9709ad5 100755 (executable)
--- a/grml2usb
+++ b/grml2usb
@@ -611,7 +611,10 @@ def install_grub(device):
                 "--root-directory=%s" % device_mountpoint, device], stdout=file(os.devnull, "r+"))
             proc.wait()
             if proc.returncode != 0:
                 "--root-directory=%s" % device_mountpoint, device], stdout=file(os.devnull, "r+"))
             proc.wait()
             if proc.returncode != 0:
-                raise Exception("error executing grub-install")
+                # raise Exception("error executing grub-install")
+                logging.critical("Fatal: error executing grub-install (please check FAQ)" % error)
+                cleanup()
+                sys.exit(1)
         except CriticalException, error:
             logging.critical("Fatal: %s" % error)
             cleanup()
         except CriticalException, error:
             logging.critical("Fatal: %s" % error)
             cleanup()