Skip to content

Commit

Permalink
Ensure options for formulas git.latest are also based on defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
myii committed Jul 1, 2016
1 parent 5f03ce9 commit c00faca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions salt/formulas.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@
{{ value|yaml }}
{%- endmacro -%}

{%- macro formulas_opts_for_git_latest(env) -%}
{%- set options = defaults['options'] or {} -%}
{%- do options.update(salt['pillar.get']('salt_formulas:git_opts:default:options') or {}) -%}
{%- do options.update(salt['pillar.get']('salt_formulas:git_opts:{0}:options'.format(env)) or {}) -%}
{{ options|yaml }}
{%- endmacro -%}

{%- macro formulas_roots(env) -%}
{%- set value = [] -%}
{%- for dir in formulas.get(env, []) -%}
Expand Down
3 changes: 2 additions & 1 deletion salt/formulas.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{% set processed_basedirs = [] %}

{% from "salt/formulas.jinja" import formulas_git_opt with context %}
{% from "salt/formulas.jinja" import formulas_opts_for_git_latest with context %}
# Loop over all formulas listed in pillar data
{% for env, entries in salt['pillar.get']('salt_formulas:list', {}).items() %}
Expand All @@ -25,7 +26,7 @@
# Setup the formula Git repository
{% if gitdir not in processed_gitdirs %}
{% do processed_gitdirs.append(gitdir) %}
{% set options = formulas_git_opt(env, 'options')|load_yaml %}
{% set options = formulas_opts_for_git_latest(env)|load_yaml %}
{% set baseurl = formulas_git_opt(env, 'baseurl')|load_yaml %}
{{ gitdir }}:
git.latest:
Expand Down

0 comments on commit c00faca

Please sign in to comment.