Skip to content

Commit 212d67b

Browse files
sol1-mattDonien
andcommitted
Fix template to properly quote numeric values
Explicitly quote numeric values in 'ini_template.j2' to ensure compatibilty with certain versions of Jinja2. Fixes #285 Co-authored-by: Donien <[email protected]>
1 parent eb777cc commit 212d67b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
3+
bugfixes:
4+
- Fix templating issue where explicitly quoting integer values for use as strings is necessary in certain versions of e.g. Jinja2 - thanks @sol1-matt

roles/icingaweb2/templates/ini_template.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[{{ section }}]
55
{% for option, value in options.items() %}
66
{% if value is number %}
7-
{{ option }} = "{{ value }}"
7+
{{ option }} = "{{ value | quote }}"
88
{% elif value is iterable and (value is not string and value is not mapping) %}
99
{{ option }} = "{{ value | join(', ') }}"
1010
{% elif ( value is string and ( "=" in value or "!" in value or " " in value ) )%}

0 commit comments

Comments
 (0)