remove prefix when not needed

This commit is contained in:
Robert Fairburn 2014-09-19 10:55:19 -05:00
parent c100fc88a3
commit ba72c1e8b7

View File

@ -7,14 +7,14 @@
{%- macro render_option(keyword, default, config_dict=sshd_config) -%} {%- macro render_option(keyword, default, config_dict=sshd_config) -%}
{%- set value = config_dict.get(keyword, default) -%} {%- set value = config_dict.get(keyword, default) -%}
{%- if value is sameas true -%} {%- if value is sameas true -%}
{{ prefix }}{{ keyword }} yes {{ keyword }} yes
{%- elif value is sameas false -%} {%- elif value is sameas false -%}
{{ prefix }}{{ keyword }} no {{ keyword }} no
{%- elif value is string or value is number -%} {%- elif value is string or value is number -%}
{{ prefix }}{{ keyword }} {{ value }} {{ keyword }} {{ value }}
{%- else -%} {%- else -%}
{%- for single_value in value -%} {%- for single_value in value -%}
{{ prefix }}{{ keyword }} {{ single_value }} {{ keyword }} {{ single_value }}
{% endfor -%} {% endfor -%}
{%- endif -%} {%- endif -%}
{%- endmacro -%} {%- endmacro -%}