handle templatedir more cleanly in ltmpl/treebuilder
make sure that runner.templatedir gets set to a useful default if initialized with None, and and make sure we pass templatedir to LoraxTemplateRunner.__init__ (so it'll get initialized properly)
This commit is contained in:
parent
96ffbc0122
commit
916402b023
@ -107,7 +107,7 @@ class LoraxTemplateRunner(object):
|
||||
self.outroot = outroot
|
||||
self.yum = yum
|
||||
self.fatalerrors = fatalerrors
|
||||
self.templatedir = templatedir
|
||||
self.templatedir = templatedir or "/usr/share/lorax"
|
||||
# some builtin methods
|
||||
self.builtins = DataHolder(exists=lambda p: rexists(p, root=inroot),
|
||||
glob=lambda g: list(rglob(g, root=inroot)))
|
||||
|
@ -72,8 +72,8 @@ class RuntimeBuilder(object):
|
||||
self.vars = DataHolder(arch=arch, product=product, yum=yum, root=root,
|
||||
basearch=arch.basearch, libdir=arch.libdir)
|
||||
self.yum = yum
|
||||
self._runner = LoraxTemplateRunner(inroot=root, outroot=root, yum=yum)
|
||||
self._runner.templatedir = templatedir
|
||||
self._runner = LoraxTemplateRunner(inroot=root, outroot=root,
|
||||
yum=yum, templatedir=templatedir)
|
||||
self._runner.defaults = self.vars
|
||||
|
||||
def install(self):
|
||||
@ -130,8 +130,7 @@ class TreeBuilder(object):
|
||||
inroot=inroot, outroot=outroot,
|
||||
basearch=arch.basearch, libdir=arch.libdir,
|
||||
udev_escape=udev_escape)
|
||||
self._runner = LoraxTemplateRunner(inroot, outroot)
|
||||
self._runner.templatedir = templatedir
|
||||
self._runner = LoraxTemplateRunner(inroot, outroot, templatedir=templatedir)
|
||||
self._runner.defaults = self.vars
|
||||
|
||||
@property
|
||||
|
Loading…
Reference in New Issue
Block a user