Check that value is defined before calling render macro

This commit is contained in:
Matt Willsher 2016-01-24 10:33:24 +00:00
parent e48ffc4e28
commit 90992da436
2 changed files with 4 additions and 0 deletions

View file

@ -23,7 +23,9 @@
{% elif sshd_defaults[key] is defined and sshd_skip_defaults != true %} {% elif sshd_defaults[key] is defined and sshd_skip_defaults != true %}
{% set value = sshd_defaults[key] %} {% set value = sshd_defaults[key] %}
{% endif %} {% endif %}
{% if value is defined %}
{{ render_option(key,value) -}} {{ render_option(key,value) -}}
{% endif %}
{% endmacro %} {% endmacro %}
{% macro match_block(match_list) %} {% macro match_block(match_list) %}
{% if match_list["Condition"] is defined %} {% if match_list["Condition"] is defined %}

View file

@ -23,7 +23,9 @@
{% elif sshd_defaults[key] is defined and sshd_skip_defaults != true %} {% elif sshd_defaults[key] is defined and sshd_skip_defaults != true %}
{% set value = sshd_defaults[key] %} {% set value = sshd_defaults[key] %}
{% endif %} {% endif %}
{% if value is defined %}
{{ render_option(key,value) -}} {{ render_option(key,value) -}}
{% endif %}
{% endmacro %} {% endmacro %}
{% macro match_block(match_list) %} {% macro match_block(match_list) %}
{% if match_list["Condition"] is defined %} {% if match_list["Condition"] is defined %}