Skip to content

Commit

Permalink
fix(map): path_join can be used only for local file access
Browse files Browse the repository at this point in the history
On windows machines, the `path_join` build wrong URL by using
backslash as separator.

URL used for fileserver access must use only slashes `/`.
  • Loading branch information
baby-gnu committed Aug 21, 2020
1 parent b32ec98 commit 3845d5f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions openssh/map.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
{%- from tplroot ~ "/libsaltcli.jinja" import cli with context %}

{#- Where to lookup parameters source files #}
{%- set map_sources_dir = tplroot | path_join("parameters") %}
{%- set map_sources_dir = tplroot ~ "/parameters" %}

{#- Load defaults first to allow per formula default map.jinja configuration #}
{%- set _defaults_filename = map_sources_dir | path_join("defaults.yaml") %}
{%- set _defaults_filename = map_sources_dir ~ "/defaults.yaml" %}
{%- do salt["log.debug"](
"map.jinja: initialise parameters from "
~ _defaults_filename
Expand Down Expand Up @@ -172,10 +172,13 @@
{%- endif %}

{%- for map_value in map_values %}
{%- set yamlfile = map_sources_dir | path_join(
{%- set yamlfile = [
map_sources_dir,
map_source,
map_value ~ ".yaml",
) %}
]
| join("/")
%}
{%- do salt["log.debug"]("map.jinja: load parameters from file " ~ yamlfile) %}
{%- load_yaml as loaded_values %}
{%- include yamlfile ignore missing %}
Expand Down

0 comments on commit 3845d5f

Please sign in to comment.