X-Git-Url: http://git.grml.org/?p=grml2usb.git;a=blobdiff_plain;f=grml2usb;h=2f63ce148a9db528e164115e2db2979114dea065;hp=072f1b339dbfd138f09c8d07c99f9ba74362030b;hb=745f09771c1a7cfd9607d3300a55ee8ddbd59fac;hpb=a3dde41af080b40f4fab46eba2950d0ea98b2785 diff --git a/grml2usb b/grml2usb index 072f1b3..2f63ce1 100755 --- a/grml2usb +++ b/grml2usb @@ -134,6 +134,12 @@ if not os.path.isdir(GRML2USB_BASE): GRML2USB_BASE = os.path.dirname(os.path.realpath(__file__)) +class HodorException(Exception): + """Throw exception if the exact error is not known and not fatal. + + @Exception: message""" + + class CriticalException(Exception): """Throw critical exception if the exact error is not known but fatal. @@ -356,9 +362,13 @@ def check_boot_flag(device): try: import parted part = get_partition_for_path(device) + if part is None: + raise HodorException("parted could not find partition") if part.getFlag(parted.PARTITION_BOOT): logging.debug("bootflag is enabled on %s" % device) return + except HodorException, e: + logging.info("%s, falling back to old bootflag detection", e) except ImportError, e: logging.debug("could not import parted, falling back to old bootflag detection") @@ -1292,7 +1302,7 @@ def initial_syslinux_config(target): def add_entry_if_not_present(filename, entry): """Write entry into filename if entry is not already in the file - @filanme: name of the file + @filename: name of the file @entry: data to write to the file """ data = open(filename, "a+")