Performance: Leverage jinja2's Environment to cache compiled Templates.
This commit is contained in:
parent
3a82f089a2
commit
9affa7753d
30 changed files with 228 additions and 235 deletions
|
|
@ -1,6 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
from jinja2 import Template
|
||||
|
||||
from moto.core.responses import BaseResponse
|
||||
from moto.ec2.utils import instance_ids_from_querystring
|
||||
|
||||
|
|
@ -10,7 +8,7 @@ class General(BaseResponse):
|
|||
self.instance_ids = instance_ids_from_querystring(self.querystring)
|
||||
instance_id = self.instance_ids[0]
|
||||
instance = self.ec2_backend.get_instance(instance_id)
|
||||
template = Template(GET_CONSOLE_OUTPUT_RESULT)
|
||||
template = self.response_template(GET_CONSOLE_OUTPUT_RESULT)
|
||||
return template.render(instance=instance)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue