From c432ae23dcc2b932a4431df952e3a04dbda85fd0 Mon Sep 17 00:00:00 2001 From: Alexander Weidinger Date: Tue, 9 Apr 2019 20:06:16 +0200 Subject: [PATCH] mapping.j2: fixed handling of OrderedDict in Python 3 --- postfix/files/mapping.j2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/postfix/files/mapping.j2 b/postfix/files/mapping.j2 index 1e564c6..7daf28d 100644 --- a/postfix/files/mapping.j2 +++ b/postfix/files/mapping.j2 @@ -21,6 +21,7 @@ {%- else %} {#- Some settings need order, handle OrderedDict #} {% for item in data %} -{{ format_value(item.keys()[0], item.values()[0]) }} +{%- set key, value = item.popitem() %} +{{ format_value(key, value) }} {%- endfor -%} {%- endif %}