Browse Source

style(mapstack): variables in macro can't be exported

No need to prefix some of them with underscore `_`.
tags/v3.0.0
Daniel Dehennin 4 years ago
parent
commit
7de2d6fd75
1 changed files with 12 additions and 12 deletions
  1. +12
    -12
      openssh/libmapstack.jinja

+ 12
- 12
openssh/libmapstack.jinja View File

{#- 1. the `value` #} {#- 1. the `value` #}
{#- 2. the `defaults` #} {#- 2. the `defaults` #}
{#- 3. the built-in #} {#- 3. the built-in #}
{%- set _strategy = matcher.value
{%- set strategy = matcher.value
| traverse( | traverse(
"strategy", "strategy",
defaults defaults
"smart" "smart"
) )
) %} ) %}
{%- set _merge_lists = matcher.value
{%- set merge_lists = matcher.value
| traverse( | traverse(
"merge_lists", "merge_lists",
defaults defaults
~ "' retrieved with '" ~ "' retrieved with '"
~ matcher.query_method ~ matcher.query_method
~ "', merge: strategy='" ~ "', merge: strategy='"
~ _strategy
~ strategy
~ "', lists='" ~ "', lists='"
~ _merge_lists
~ merge_lists
~ "':\n" ~ "':\n"
~ value ~ value
| yaml(False) | yaml(False)
"values": salt["slsutil.merge"]( "values": salt["slsutil.merge"](
stack["values"], stack["values"],
value, value,
strategy=_strategy,
merge_lists=_merge_lists,
strategy=strategy,
merge_lists=merge_lists,
) )
} }
) %} ) %}
{#- 1. the `value` #} {#- 1. the `value` #}
{#- 2. the `defaults` #} {#- 2. the `defaults` #}
{#- 3. the built-in #} {#- 3. the built-in #}
{%- set _strategy = yaml_values
{%- set strategy = yaml_values
| traverse( | traverse(
"strategy", "strategy",
defaults defaults
"smart" "smart"
) )
) %} ) %}
{%- set _merge_lists = yaml_values
{%- set merge_lists = yaml_values
| traverse( | traverse(
"merge_lists", "merge_lists",
defaults defaults
stack["values"], stack["values"],
yaml_values yaml_values
| traverse("values", {}), | traverse("values", {}),
strategy=_strategy,
merge_lists=_merge_lists,
strategy=strategy,
merge_lists=merge_lists,
) )
} }
) %} ) %}
~ "merged configuration values from " ~ "merged configuration values from "
~ yaml_name ~ yaml_name
~ ", merge: strategy='" ~ ", merge: strategy='"
~ _strategy
~ strategy
~ "', merge_lists='" ~ "', merge_lists='"
~ _merge_lists
~ merge_lists
~ "':\n" ~ "':\n"
~ {"values": stack["values"]} ~ {"values": stack["values"]}
| yaml(False) | yaml(False)

Loading…
Cancel
Save