From 2c97cd79c9a20a157336a89b2c36d14c7b3e759b Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sat, 21 Jan 2017 00:59:22 -0500 Subject: [PATCH] Refactored. --- keepalived/templates/config.jinja | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/keepalived/templates/config.jinja b/keepalived/templates/config.jinja index 528d267..8219581 100644 --- a/keepalived/templates/config.jinja +++ b/keepalived/templates/config.jinja @@ -14,15 +14,14 @@ {%- set indent = indent + 2 -%} {%- endif -%} {%- if data is mapping -%} - {%- set indentHolder = indent -%} {%- for item in data|dictsort -%} {%- if item[key] in carryovers -%} {{- keepalived_config(item[value], carryover=item[key], indent=indent) -}} {%- else -%} - {%- set carryIndent = indentHolder -%} - {%- set forwardIndent = indentHolder -%} + {%- set carryIndent = indent -%} + {%- set forwardIndent = indent -%} {%- if carryover -%} - {{- carryover|indent(indentHolder, True) }}{{ ' ' -}} + {{- carryover|indent(indent, True) }}{{ ' ' -}} {%- set carryIndent = 0 -%} {%- endif -%} {%- if item[value] is string or item[value] is not iterable -%}