'jinja giving error on pillar variable with absolute folder path

I got a pillar item which looks something like below:

 "fileabspath": [
"Z:\\customer\region\chicago"
]

And on my sls file, I am trying to access the "filepath" pillar value with the below:

{% set fileabspath = salt['pillar.get']('fileabspath', None) %}

customer:
  region.filepath:
    - name: '{{fileabspath}}'

As soon as job hits above last line, I get below error.

failed: while parsing a block mapping\n  in \"<unicode string>\", line 10, column 1\ndid not find expected key\n  in \"<unicode string>\"

Any advice how to fix the issue ? Thank you.



Solution 1:[1]

You need to escape the backslashes if you're using that data format

"fileabspath": [
  "Z:\\\\customer\\region\\chicago"
]

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 OrangeDog