summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
a06f95e)
* Remove "Error:" prefix which will be added as "Critical:" anyway.
* Fix wrong usage of string formatting parameters.
def check_uid_root():
"""Check for root permissions"""
if not os.geteuid() == 0:
def check_uid_root():
"""Check for root permissions"""
if not os.geteuid() == 0:
- sys.exit("Error: please run this script with uid 0 (root).")
+ raise CriticalException("please run this script with uid 0 (root).")
def check_boot_flag(device):
def check_boot_flag(device):
if not os.path.isfile(mbrtemplate):
logging.error('Error installing MBR (either try --syslinux-mbr or '
'install missing file "%s"?)', mbrtemplate)
if not os.path.isfile(mbrtemplate):
logging.error('Error installing MBR (either try --syslinux-mbr or '
'install missing file "%s"?)', mbrtemplate)
- raise CriticalException("Error: %s can not be read.", mbrtemplate)
+ raise CriticalException("%s can not be read." % mbrtemplate)
if partition is not None and ((partition < 0) or (partition > 3)):
logging.warn("Cannot activate partition %d", partition)
if partition is not None and ((partition < 0) or (partition > 3)):
logging.warn("Cannot activate partition %d", partition)
@opts option dict from OptionParser
"""
if opts.grubmbr and not opts.grub:
@opts option dict from OptionParser
"""
if opts.grubmbr and not opts.grub:
- logging.critical("Error: --grub-mbr requires --grub option.")
- sys.exit(1)
+ raise CriticalException("--grub-mbr requires --grub option.")