Browse Source

fix(map): `path_join` can be used only for local file access

On windows machines, the `path_join` build wrong URL by using
backslash as separator.

URL used for fileserver access must use only slashes `/`.
tags/v2.0.1
Daniel Dehennin 4 years ago
parent
commit
3845d5ff61
1 changed files with 7 additions and 4 deletions
  1. +7
    -4
      openssh/map.jinja

+ 7
- 4
openssh/map.jinja View File

{%- from tplroot ~ "/libsaltcli.jinja" import cli with context %} {%- from tplroot ~ "/libsaltcli.jinja" import cli with context %}


{#- Where to lookup parameters source files #} {#- 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 #} {#- 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"]( {%- do salt["log.debug"](
"map.jinja: initialise parameters from " "map.jinja: initialise parameters from "
~ _defaults_filename ~ _defaults_filename
{%- endif %} {%- endif %}


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

Loading…
Cancel
Save