Skip to content

Commit

Permalink
Fix quoting in template and quote if first char is !
Browse files Browse the repository at this point in the history
  • Loading branch information
mkayontour committed Jan 3, 2024
1 parent 12c4ac1 commit 843629c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/fix_advanced_ldap_filters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- "Fix quoting for ! in templating Issue #208"
4 changes: 3 additions & 1 deletion roles/icingaweb2/templates/ini_template.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
{{ option }} = "{{ value }}"
{% elif value is iterable and (value is not string and value is not mapping) %}
{{ option }} = "{{ value | join(', ') }}"
{% elif value|first == "!" %}
{{ option }} = {{ value | quote }}
{% elif value is string and "=" in value %}
{{ option }} = "{{ value | quote }}"
{{ option }} = {{ value | quote }}
{% else %}
{{ option }} = {{ value }}
{% endif %}
Expand Down

0 comments on commit 843629c

Please sign in to comment.