default to fatalerrors=True in LoraxTemplateRunner

This means that any (non-ignored) command error will cause lorax to
exit.

Do note, however, that some commands (e.g. remove, installpkg) don't
raise exceptions and therefore will not cause lorax to exit.
This commit is contained in:
Will Woods 2011-10-26 13:09:50 -04:00
parent 0e64f08ff8
commit dfa7742a6d

View File

@ -95,12 +95,11 @@ def rglob(pathname, root="/", fatal=False):
def rexists(pathname, root=""): def rexists(pathname, root=""):
return True if rglob(pathname, root) else False return True if rglob(pathname, root) else False
# TODO: default to strict mode (fatalerrors=True)
# XXX NOTE: symlinks to stuff outside inroot/outroot will make us operate # XXX NOTE: symlinks to stuff outside inroot/outroot will make us operate
# on files outside our roots (e.g. deleting files on the host system). # on files outside our roots (e.g. deleting files on the host system).
# TODO: operate inside an actual chroot for safety? Not that RPM bothers.. # TODO: operate inside an actual chroot for safety? Not that RPM bothers..
class LoraxTemplateRunner(object): class LoraxTemplateRunner(object):
def __init__(self, inroot, outroot, yum=None, fatalerrors=False, def __init__(self, inroot, outroot, yum=None, fatalerrors=True,
templatedir=None, defaults={}): templatedir=None, defaults={}):
self.inroot = inroot self.inroot = inroot
self.outroot = outroot self.outroot = outroot