treebuilder fixup: handle treeinfo_data as runner.results
This commit is contained in:
parent
7323749706
commit
3faac26a93
@ -79,7 +79,6 @@ class BaseBuilder(object):
|
|||||||
self.inroot = inroot
|
self.inroot = inroot
|
||||||
self.outroot = outroot
|
self.outroot = outroot
|
||||||
self.templatedir = templatedir
|
self.templatedir = templatedir
|
||||||
self.runner = None
|
|
||||||
|
|
||||||
def getdefaults(self):
|
def getdefaults(self):
|
||||||
return dict(arch=self.arch, product=self.product,
|
return dict(arch=self.arch, product=self.product,
|
||||||
@ -99,9 +98,10 @@ class BaseBuilder(object):
|
|||||||
# parse and run the template
|
# parse and run the template
|
||||||
t = LoraxTemplate(directories=[self.templatedir])
|
t = LoraxTemplate(directories=[self.templatedir])
|
||||||
template = t.parse(tfile, tvars)
|
template = t.parse(tfile, tvars)
|
||||||
self.runner = TemplateRunner(template, **tvars)
|
runner = TemplateRunner(template, **tvars)
|
||||||
logger.info("running template commands")
|
logger.info("running template commands")
|
||||||
self.runner.run()
|
runner.run()
|
||||||
|
return runner
|
||||||
|
|
||||||
class RuntimeBuilder(BaseBuilder):
|
class RuntimeBuilder(BaseBuilder):
|
||||||
'''Builds the anaconda runtime image.
|
'''Builds the anaconda runtime image.
|
||||||
@ -141,14 +141,11 @@ class TreeBuilder(BaseBuilder):
|
|||||||
'''Builds the arch-specific boot images.
|
'''Builds the arch-specific boot images.
|
||||||
inroot should be the installtree root (the newly-built runtime dir)'''
|
inroot should be the installtree root (the newly-built runtime dir)'''
|
||||||
def build(self):
|
def build(self):
|
||||||
self.runtemplate(templatemap[self.arch.basearch], kernels=self.kernels)
|
template = templatemap[self.arch.basearch]
|
||||||
|
runner = self.runtemplate(template, kernels=self.kernels)
|
||||||
|
self.treeinfo_data = runner.results.treeinfo
|
||||||
self.implantisomd5()
|
self.implantisomd5()
|
||||||
|
|
||||||
@property
|
|
||||||
def treeinfo_data(self):
|
|
||||||
if self.runner:
|
|
||||||
return self.runner.treeinfo_data
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def kernels(self):
|
def kernels(self):
|
||||||
return findkernels(root=self.inroot)
|
return findkernels(root=self.inroot)
|
||||||
@ -214,7 +211,7 @@ class TemplateRunner(object):
|
|||||||
self.fatalerrors = fatalerrors
|
self.fatalerrors = fatalerrors
|
||||||
self.kwargs = kwargs
|
self.kwargs = kwargs
|
||||||
|
|
||||||
self.treeinfo_data = dict()
|
self.results = DataHolder(treeinfo=dict()) # just treeinfo right now
|
||||||
self.exists = lambda p: _exists(p, root=inroot)
|
self.exists = lambda p: _exists(p, root=inroot)
|
||||||
|
|
||||||
def _out(self, path):
|
def _out(self, path):
|
||||||
@ -258,9 +255,9 @@ class TemplateRunner(object):
|
|||||||
fobj.write(data+"\n")
|
fobj.write(data+"\n")
|
||||||
|
|
||||||
def treeinfo(self, section, key, *valuetoks):
|
def treeinfo(self, section, key, *valuetoks):
|
||||||
if section not in self.treeinfo_data:
|
if section not in self.results.treeinfo:
|
||||||
self.treeinfo_data[section] = dict()
|
self.results.treeinfo[section] = dict()
|
||||||
self.treeinfo_data[section][key] = " ".join(valuetoks)
|
self.results.treeinfo[section][key] = " ".join(valuetoks)
|
||||||
|
|
||||||
def installkernel(self, section, src, dest):
|
def installkernel(self, section, src, dest):
|
||||||
self.install(src, dest)
|
self.install(src, dest)
|
||||||
|
Loading…
Reference in New Issue
Block a user