From dfa7742a6da55d5ecc63021614f1e83482052867 Mon Sep 17 00:00:00 2001 From: Will Woods Date: Wed, 26 Oct 2011 13:09:50 -0400 Subject: [PATCH] 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. --- src/pylorax/ltmpl.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pylorax/ltmpl.py b/src/pylorax/ltmpl.py index 13952910..6b21ec7f 100644 --- a/src/pylorax/ltmpl.py +++ b/src/pylorax/ltmpl.py @@ -95,12 +95,11 @@ def rglob(pathname, root="/", fatal=False): def rexists(pathname, root=""): 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 # 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.. class LoraxTemplateRunner(object): - def __init__(self, inroot, outroot, yum=None, fatalerrors=False, + def __init__(self, inroot, outroot, yum=None, fatalerrors=True, templatedir=None, defaults={}): self.inroot = inroot self.outroot = outroot