From 569f65ab3d6a376e5a9f396c7e134e2f7d15237b Mon Sep 17 00:00:00 2001 From: Theo Chatzimichos Date: Nov 13 2017 22:03:12 +0000 Subject: Merge branch 'cboltz-fix-include-optional' into 'production' fix include_optional() for salt/ See merge request infra/salt!92 --- diff --git a/salt/macros.jinja b/salt/macros.jinja index e5ad3a7..1d8e8c0 100644 --- a/salt/macros.jinja +++ b/salt/macros.jinja @@ -1,7 +1,7 @@ {%- macro include_optional(sls_file) %} - {%- for root in opts['file_roots'][saltenv] -%} - {%- if salt['file.file_exists']('{0}/{1}/init.sls'.format(root, sls_file)) or salt['file.file_exists']('{0}/{1}.sls'.format(root, sls_file)) %} + {%- if salt['file.file_exists']('{0}/files/{1}/{2}/init.sls'.format(opts['cachedir'], saltenv, sls_file)) or + salt['file.file_exists']('{0}/files/{1}/{2}.sls'.format(opts['cachedir'], saltenv, sls_file)) + %} - {{ sls_file }} {% endif %} - {%- endfor %} {%- endmacro %}