jp (output/template): initialize template rendered only if a rendering is actually needed
This commit is contained in:
parent
9ea4dba14d
commit
40e764cab5
1 changed files with 1 additions and 1 deletions
|
|
@ -37,7 +37,6 @@ class Template(object):
|
|||
def __init__(self, jp):
|
||||
self.host = jp
|
||||
jp.register_output(C.OUTPUT_COMPLEX, TEMPLATE, self.render)
|
||||
self.renderer = template.Renderer(jp)
|
||||
|
||||
def render(self, data):
|
||||
"""render output data using requested template
|
||||
|
|
@ -49,6 +48,7 @@ class Template(object):
|
|||
command's template_data_mapping attribute will be used if it exists to convert
|
||||
data to a dict usable by the template.
|
||||
"""
|
||||
self.renderer = template.Renderer(self.host)
|
||||
cmd = self.host.command
|
||||
options = self.host.parse_output_options()
|
||||
self.host.check_output_options(OPTIONS, options)
|
||||
|
|
|
|||
Loading…
Reference in a new issue