Remove extra whitespaces in generated file

This commit is contained in:
Gilles Dartiguelongue 2015-08-22 23:55:56 +02:00
parent 609737b0cc
commit 6bec84cc23

View File

@ -1,21 +1,20 @@
{% from "postfix/map.jinja" import postfix with context %} {%- from "postfix/map.jinja" import postfix with context -%}
{%- set config = salt['pillar.get']('postfix:config', {}) -%}
{% set config = salt['pillar.get']('postfix:config', {}) -%} {% set processed_parameters = ['aliases_file', 'virtual'] %}
{% set processed_parameters = ['aliases_file', 'virtual'] -%} {%- macro set_parameter(parameter, default=None) -%}
{% macro set_parameter(parameter, default=None) -%} {% set value = config.get(parameter, default) %}
{% set value = config.get(parameter, default) -%} {%- if value is not none %}
{% if value is not none -%} {%- if value is number or value is string -%}
{%- if value is number or value is string %}
{{ parameter }} = {{ value }} {{ parameter }} = {{ value }}
{%- elif value is iterable %} {%- elif value is iterable -%}
{{ parameter }} = {{ parameter }} =
{%- for v in value %} {%- for v in value %}
{{ v }}, {{ v }},
{%- endfor %} {%- endfor %}
{%- endif %} {%- endif -%}
{%- do processed_parameters.append(parameter) -%} {%- do processed_parameters.append(parameter) %}
{% endif -%} {%- endif %}
{% endmacro -%} {%- endmacro -%}
# Managed by config management # Managed by config management
# See /usr/share/postfix/main.cf.dist for a commented, more complete version # See /usr/share/postfix/main.cf.dist for a commented, more complete version