Bugfixes.
authormeisterluk <admin@lukas-prokop.at>
Mon, 6 May 2013 19:38:08 +0000 (21:38 +0200)
committerMichael Prokop <mika@grml.org>
Mon, 13 May 2013 09:04:14 +0000 (11:04 +0200)
Several bugfixes concerning the error handling of the previous commits.

grml2usb

index 6cb76c0..b0a1fc2 100755 (executable)
--- a/grml2usb
+++ b/grml2usb
@@ -796,7 +796,7 @@ def copy_system_files(grml_flavour, iso_mount, target):
     squashfs = search_file(grml_flavour + '.squashfs', iso_mount)
     if squashfs is None:
         logging.error("error locating squashfs file")
-        raise CriticalException("Fatal: squashfs file not found"
+        raise CriticalException("squashfs file not found"
             ", please check that your iso is not corrupt")
     else:
         squashfs_target = target + '/live/' + grml_flavour + '/'
@@ -1048,8 +1048,8 @@ def copy_bootloader_files(iso_mount, target, grml_flavour):
 
     if not source_dir:
         raise CriticalException(
-            "Fatal: file default.cfg could not be found." \
-            "Note:  this grml2usb version requires an ISO generated by grml-live >=0.9.24 ..." \
+            "file default.cfg could not be found.\n"
+            "Note:  this grml2usb version requires an ISO generated by grml-live >=0.9.24 ...\n"
             "       ... either use grml releases >=2009.10 or switch to an older grml2usb version.")
 
     if not os.path.exists(iso_mount + '/boot/grub/footer.cfg'):
@@ -1488,8 +1488,8 @@ def install(image, device):
             try:
                 remove_mountpoint(iso_mountpoint)
             except CriticalException, error:
-                logging.critical("Fatal: %s", error)
                 cleanup()
+                raise
 
 
 def install_grml(mountpoint, device):
@@ -1511,7 +1511,6 @@ def install_grml(mountpoint, device):
             check_boot_flag(device)
             mount(device, device_mountpoint, ['-o', 'utf8,iocharset=iso8859-1'])
         except VerifyException, error:
-            logging.critical("Fatal: %s", error)
             raise
         except CriticalException, error:
             mount(device, device_mountpoint, "")
@@ -1538,8 +1537,8 @@ def remove_mountpoint(mountpoint):
             os.rmdir(mountpoint)
             unregister_tmpfile(mountpoint)
     except CriticalException, error:
-        logging.critical("Fatal: %s", error)
         cleanup()
+        raise
 
 
 def handle_mbr(device):