1 # -*- coding: utf-8 -*-
2 # SPDX-License-Identifier: Apache-2.0
5 from jinja2 import Environment, PackageLoader, select_autoescape, ChoiceLoader
8 def jinja_env() -> Environment:
9 """Create Jinja environment.
11 jinja_env allow to fetch simply jinja templates where they are.
12 by default jinja engine will look for templates in `templates` directory of
13 the package. So to load a template, you just have to do:
16 >>> template = jinja_env().get_template('vendor_create.json.j2')
17 >>> data = template.render(name="vendor")
20 SdcElement.create() for real use
23 Environment: the Jinja environment to use
26 return Environment(autoescape=select_autoescape(['html', 'htm', 'xml']),
28 PackageLoader("oransdk.a1sim"),
29 PackageLoader("oransdk.dmaap"),
30 PackageLoader("oransdk.enrichmentservice"),
31 PackageLoader("oransdk.policy")