Skip to content

Instantly share code, notes, and snippets.

/data.sls Secret

Created February 11, 2016 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/b835f8008aa988ab2e84 to your computer and use it in GitHub Desktop.
Save anonymous/b835f8008aa988ab2e84 to your computer and use it in GitHub Desktop.
settings:
- foo
- bar
- baz: /opt
{%- macro build_configure_options_from_settings(settings) -%}
{%- set output = [] -%}
{%- for item in settings['configure'] -%}
{%- if item is mapping -%}
{%- set output = output.extend(["--" + (item | join('='))]) -%}
{%- else -%}
{%- set output = output.extend(["--" + item]) -%}
{%- endif -%}
{%- endfor -%}
{{ output | join(' ') }}
{%- endmacro -%}
Jinja variable 'None' has no attribute 'extend'
[...]
{%- for item in settings['configure'] -%}
{%- if item is mapping -%}
{%- set output = output.extend(["--" + (item | join('='))]) -%}
{%- else -%}
{%- set output = output.extend(["--" + item]) -%} <======================
{%- endif -%}
{%- endfor -%}
{{ output | join(' ') }}
[...]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment