From 3845d5ff618f936700d5180ce9ff11ba1b037bcc Mon Sep 17 00:00:00 2001 From: Daniel Dehennin Date: Fri, 21 Aug 2020 16:00:56 +0200 Subject: [PATCH] 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 `/`. --- openssh/map.jinja | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/openssh/map.jinja b/openssh/map.jinja index 85e39b1..018e7e1 100644 --- a/openssh/map.jinja +++ b/openssh/map.jinja @@ -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 @@ -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 %}