From 50fdd24d421dbc5dec9a5a140641c4b4760ede84 Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 23 Oct 2016 23:16:13 -0400 Subject: [PATCH] Added null string handler. --- keepalived/templates/keepalived.jinja | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index d752f04..aa530fc 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -14,7 +14,7 @@ {%- set groupings = ['vrrp_script', 'vrrp_sync_group', 'vrrp_instance', 'virtual_server_group', 'virtual_server', 'real_server'] -%} {%- macro config_entries(data, indents, carryover='') -%} - {%- if data is string or data is number -%} + {%- if data is string or data is number or data is not defined -%} {{ data|string|indent(indents, True) }}{{ '\n' }} {%- else -%} {%- if indents != 0 and not carryover -%} @@ -29,9 +29,7 @@ {{ carryover|indent(indents, True) }}{{ ' ' }} {%- endif -%} {{ entry[0]|indent(indents, True) }} - {%- if entry[1] is defined -%} {{- config_entries(entry[1], indents + 2) -}} - {%- endif -%} {%- endif -%} {%- endfor -%} {%- else -%}