Merge "Use Jinja2 sandbox environment"
This commit is contained in:
commit
7af91479b9
@ -16,6 +16,7 @@ import re
|
|||||||
|
|
||||||
import jinja2
|
import jinja2
|
||||||
from jinja2 import parser as jinja_parse
|
from jinja2 import parser as jinja_parse
|
||||||
|
from jinja2.sandbox import SandboxedEnvironment
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
import six
|
import six
|
||||||
|
|
||||||
@ -29,7 +30,7 @@ LOG = logging.getLogger(__name__)
|
|||||||
JINJA_REGEXP = '({{(.*)}})'
|
JINJA_REGEXP = '({{(.*)}})'
|
||||||
JINJA_BLOCK_REGEXP = '({%(.*)%})'
|
JINJA_BLOCK_REGEXP = '({%(.*)%})'
|
||||||
|
|
||||||
_environment = jinja2.Environment(
|
_environment = SandboxedEnvironment(
|
||||||
undefined=jinja2.StrictUndefined,
|
undefined=jinja2.StrictUndefined,
|
||||||
trim_blocks=True,
|
trim_blocks=True,
|
||||||
lstrip_blocks=True
|
lstrip_blocks=True
|
||||||
|
Loading…
Reference in New Issue
Block a user