From 34b41e861b0a0e745f2d70d34e251b3721fd323d Mon Sep 17 00:00:00 2001 From: Kylian Serrania Date: Wed, 11 Dec 2019 09:23:02 +0100 Subject: [PATCH 1/2] Use indentfirst instead of first in system-probe.yaml.j2 --- templates/system-probe.yaml.j2 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/templates/system-probe.yaml.j2 b/templates/system-probe.yaml.j2 index deb28ef1..e02593f6 100644 --- a/templates/system-probe.yaml.j2 +++ b/templates/system-probe.yaml.j2 @@ -2,7 +2,14 @@ {% if system_probe_config is defined and system_probe_config|length > 0 -%} system_probe_config: -{% filter indent(width=2, first=True) %} +{# The "first" option is only supported by jinja 2.10+ + which is not present on older systems (CentOS 7, Debian 8, etc.) + Using the equivalent option "indentfirst" will work with + all currently existing jinja 2 versions (as of this comment, up to 2.10). + The only downside is that this will print a deprecation warning if used + with jinja 2.10+. + #} +{% filter indent(width=2, indentfirst=True) %} {{ system_probe_config | to_nice_yaml }} {% endfilter %} {% endif %} From 2a25a8d098830655b25a6d85bfec3c6d5f67c3c0 Mon Sep 17 00:00:00 2001 From: Kylian Serrania Date: Thu, 12 Dec 2019 14:34:57 +0100 Subject: [PATCH 2/2] Add TODO --- templates/system-probe.yaml.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/system-probe.yaml.j2 b/templates/system-probe.yaml.j2 index e02593f6..50138b2b 100644 --- a/templates/system-probe.yaml.j2 +++ b/templates/system-probe.yaml.j2 @@ -6,8 +6,8 @@ system_probe_config: which is not present on older systems (CentOS 7, Debian 8, etc.) Using the equivalent option "indentfirst" will work with all currently existing jinja 2 versions (as of this comment, up to 2.10). - The only downside is that this will print a deprecation warning if used - with jinja 2.10+. + TODO: when future versions of Jinja are released, check that + indentfirst is still supported. #} {% filter indent(width=2, indentfirst=True) %} {{ system_probe_config | to_nice_yaml }}