2
0

Merge pull request #176 from irtnog/fix-formulas-mapping-values-not-allowed-render-error

Filter all calls to formulas_git_opt through load_yaml
This commit is contained in:
Brian Jackson 2015-09-03 14:28:56 -05:00
commit 32d2de264f
2 changed files with 5 additions and 3 deletions

View File

@ -17,7 +17,8 @@
{%- macro formulas_roots(env) -%}
{%- set value = [] -%}
{%- for dir in formulas.get(env, []) -%}
{%- do value.append('{0}/{1}'.format(formulas_git_opt(env, 'basedir'), dir)) -%}
{%- set basedir = formulas_git_opt(env, 'basedir')|load_yaml -%}
{%- do value.append('{0}/{1}'.format(basedir, dir)) -%}
{%- endfor -%}
{{ value|yaml }}
{%- endmacro -%}

View File

@ -7,7 +7,7 @@
{% for env, entries in salt['pillar.get']('salt_formulas:list', {}).iteritems() %}
{% for entry in entries %}
{% set basedir = formulas_git_opt(env, 'basedir') %}
{% set basedir = formulas_git_opt(env, 'basedir')|load_yaml %}
{% set gitdir = '{0}/{1}'.format(basedir, entry) %}
{% set update = formulas_git_opt(env, 'update')|load_yaml %}
@ -26,9 +26,10 @@
{% if gitdir not in processed_gitdirs %}
{% do processed_gitdirs.append(gitdir) %}
{% set options = formulas_git_opt(env, 'options')|load_yaml %}
{% set baseurl = formulas_git_opt(env, 'baseurl')|load_yaml %}
{{ gitdir }}:
git.latest:
- name: {{ formulas_git_opt(env, 'baseurl') }}/{{ entry }}.git
- name: {{ baseurl }}/{{ entry }}.git
- target: {{ gitdir }}
{%- for key, value in options.iteritems() %}
- {{ key }}: {{ value }}