File tree 12 files changed +44
-17
lines changed 12 files changed +44
-17
lines changed Original file line number Diff line number Diff line change 3
3
---
4
4
{# - Get the `tplroot` from `tpldir` #}
5
5
{%- set tplroot = tpldir.split(" /" )[0 ] %}
6
- {%- from tplroot ~ " /map.jinja" import mapdata with context % }
6
+ {%- from tplroot ~ " /map.jinja" import mapdata without context % }
7
7
8
8
{%- set _mapdata = {
9
9
" values" : mapdata,
Original file line number Diff line number Diff line change 4
4
{# - Get the `tplroot` from `tpldir` #}
5
5
{%- set tplroot = tpldir.split(' /' )[0 ] %}
6
6
{%- set sls_service_clean = tplroot ~ ' .service.clean' %}
7
- {%- from tplroot ~ " /map.jinja" import mapdata as TEMPLATE with context % }
7
+ {%- from tplroot ~ " /map.jinja" import mapdata as TEMPLATE without context % }
8
8
9
9
include:
10
10
- {{ sls_service_clean }}
Original file line number Diff line number Diff line change 4
4
{# - Get the `tplroot` from `tpldir` #}
5
5
{%- set tplroot = tpldir.split(' /' )[0 ] %}
6
6
{%- set sls_package_install = tplroot ~ ' .package.install' %}
7
- {%- from tplroot ~ " /map.jinja" import mapdata as TEMPLATE with context % }
7
+ {%- from tplroot ~ " /map.jinja" import mapdata as TEMPLATE without context % }
8
8
{%- from tplroot ~ " /libtofs.jinja" import files_switch with context % }
9
9
10
10
include:
Original file line number Diff line number Diff line change 1
1
{#- -*- coding: utf-8 -*- #}
2
2
{#- vim: ft=jinja #}
3
3
4
- {#- Get the `tplroot` from `tpldir` #}
5
- {% - set tplroot = tpldir .split ("/" )[0] %}
4
+ {% - if not tplfile .endswith ("/libmapstack.jinja" ) %}
5
+ {#- Force import `without context` #}
6
+ {#- `with context` override the `tplfile` and `tpldir` variables #}
7
+ {{- raise("Import error: libmapstack.jinja must be imported without context. tplfile='" ~ tplfile ~ "'") }}
8
+ {% - elif tplfile .startswith ("../" ) %}
9
+ {#- Force import with absolute path #}
10
+ {{- raise("Import error: libmapstack.jinja must be imported with absolute path. tplfile='" ~ tplfile ~ "'") }}
11
+ {% - endif %}
12
+
13
+ {#- `tplroot` is the directory of the current imported file #}
14
+ {% - set tplroot = tpldir %}
6
15
{% - from tplroot ~ "/libmatchers.jinja" import parse_matchers , query_map %}
7
16
8
17
{% - set _default_config_dirs = [
Original file line number Diff line number Diff line change 1
1
{#- -*- coding: utf-8 -*- #}
2
2
{#- vim: ft=jinja #}
3
3
4
+ {% - if not tplfile .endswith ("/libmatchers.jinja" ) %}
5
+ {#- Force import `without context` #}
6
+ {#- `with context` override the `tplfile` and `tpldir` variables #}
7
+ {{- raise("Import error: libmatchers.jinja must be imported without context. tplfile='" ~ tplfile ~ "'") }}
8
+ {% - elif tplfile .startswith ("../" ) %}
9
+ {#- Force import with absolute path #}
10
+ {{- raise("Import error: libmatchers.jinja must be imported with absolute path. tplfile='" ~ tplfile ~ "'") }}
11
+ {% - endif %}
12
+
4
13
{#- Get the `tplroot` from `tpldir` #}
5
- {% - set tplroot = tpldir . split ( "/" )[0] %}
14
+ {% - set tplroot = tpldir %}
6
15
{% - from tplroot ~ "/libsaltcli.jinja" import cli %}
7
16
8
17
{% - set query_map = {
Original file line number Diff line number Diff line change 1
- # -*- coding: utf-8 -*-
2
- # vim: ft=jinja
1
+ {#- -*- coding: utf-8 -*- #}
2
+ {#- vim: ft=jinja #}
3
3
4
- {#- Get the `tplroot` from `tpldir` #}
5
- {% - set tplroot = tpldir .split ("/" )[0] %}
6
- {% - from tplroot ~ "/libmapstack.jinja" import mapstack %}
4
+ {% - if not tplfile .endswith ("/map.jinja" ) %}
5
+ {#- Force import `without context` #}
6
+ {#- `with context` override the `tplfile` and `tpldir` variables #}
7
+ {{- raise("Import error: map.jinja must be imported without context. tplfile='" ~ tplfile ~ "'") }}
8
+ {% - elif tplfile .startswith ("../" ) %}
9
+ {#- Force import with absolute path #}
10
+ {{- raise("Import error: map.jinja must be imported with absolute path. tplfile='" ~ tplfile ~ "'") }}
11
+ {% - endif %}
12
+
13
+ {#- `tplroot` is the directory of the current imported file #}
14
+ {% - set tplroot = tpldir %}
15
+ {% - from tplroot ~ "/libmapstack.jinja" import mapstack without context %}
7
16
8
17
{#- Where to lookup parameters source files #}
9
18
{% - set formula_param_dir = tplroot ~ "/parameters" %}
Original file line number Diff line number Diff line change 4
4
{# - Get the `tplroot` from `tpldir` #}
5
5
{%- set tplroot = tpldir.split(' /' )[0 ] %}
6
6
{%- set sls_config_clean = tplroot ~ ' .config.clean' %}
7
- {%- from tplroot ~ " /map.jinja" import mapdata as TEMPLATE with context % }
7
+ {%- from tplroot ~ " /map.jinja" import mapdata as TEMPLATE without context % }
8
8
9
9
include:
10
10
- {{ sls_config_clean }}
Original file line number Diff line number Diff line change 3
3
4
4
{# - Get the `tplroot` from `tpldir` #}
5
5
{%- set tplroot = tpldir.split(' /' )[0 ] %}
6
- {%- from tplroot ~ " /map.jinja" import mapdata as TEMPLATE with context % }
6
+ {%- from tplroot ~ " /map.jinja" import mapdata as TEMPLATE without context % }
7
7
8
8
TEMPLATE - package- install- pkg- installed:
9
9
pkg.installed:
Original file line number Diff line number Diff line change 3
3
4
4
{# - Get the `tplroot` from `tpldir` #}
5
5
{%- set tplroot = tpldir.split(' /' )[0 ] %}
6
- {%- from tplroot ~ " /map.jinja" import mapdata as TEMPLATE with context % }
6
+ {%- from tplroot ~ " /map.jinja" import mapdata as TEMPLATE without context % }
7
7
8
8
TEMPLATE - service- clean- service- dead:
9
9
service.dead:
Original file line number Diff line number Diff line change 4
4
{# - Get the `tplroot` from `tpldir` #}
5
5
{%- set tplroot = tpldir.split(' /' )[0 ] %}
6
6
{%- set sls_config_file = tplroot ~ ' .config.file' %}
7
- {%- from tplroot ~ " /map.jinja" import mapdata as TEMPLATE with context % }
7
+ {%- from tplroot ~ " /map.jinja" import mapdata as TEMPLATE without context % }
8
8
9
9
include:
10
10
- {{ sls_config_file }}
Original file line number Diff line number Diff line change 4
4
{# - Get the `tplroot` from `tpldir` #}
5
5
{%- set tplroot = tpldir.split(' /' )[0 ] %}
6
6
{%- set sls_service_clean = tplroot ~ ' .service.clean' %}
7
- {%- from tplroot ~ " /map.jinja" import mapdata as TEMPLATE with context % }
7
+ {%- from tplroot ~ " /map.jinja" import mapdata as TEMPLATE without context % }
8
8
9
9
include:
10
10
- {{ sls_service_clean }}
Original file line number Diff line number Diff line change 4
4
{# - Get the `tplroot` from `tpldir` #}
5
5
{%- set tplroot = tpldir.split(' /' )[0 ] %}
6
6
{%- set sls_config_file = tplroot ~ ' .config.file' %}
7
- {%- from tplroot ~ " /map.jinja" import mapdata as TEMPLATE with context % }
7
+ {%- from tplroot ~ " /map.jinja" import mapdata as TEMPLATE without context % }
8
8
{%- from tplroot ~ " /libtofs.jinja" import files_switch with context % }
9
9
10
10
include:
You can’t perform that action at this time.
0 commit comments