From 2fe2640e9e3bb2d722c45fcca9bfa0f53a8ecc01 Mon Sep 17 00:00:00 2001 From: Pavel 'LEdoian' Turinsky Date: Mon, 25 Apr 2022 01:31:28 +0200 Subject: [PATCH] Fix alignment of templated files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Jinja directives keep indentation. Therefore, if tokens like `{% for … %}` are indented, the indentation accumulates and this creates confusing indentation in output. --- templates/bird.conf | 4 ++-- templates/interfaces | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/bird.conf b/templates/bird.conf index ce77243..df9b12b 100644 --- a/templates/bird.conf +++ b/templates/bird.conf @@ -18,12 +18,12 @@ protocol ospf v3 { export all; }; area 0 { - {% for br in c.bridges %} +{% for br in c.bridges %} interface "net_{{br.num}}" { cost 10; type broadcast; }; - {% endfor %} +{% endfor %} }; } diff --git a/templates/interfaces b/templates/interfaces index cf2bb48..4ed1140 100644 --- a/templates/interfaces +++ b/templates/interfaces @@ -5,9 +5,9 @@ iface lo inet loopback auto /eth* mapping eth* script TODO/get-mac-address.sh - {% for br in c.bridges %} +{% for br in c.bridges %} map 52:54:00:17:{{ '%02x:%02x' % (c.num, br.num) }} net_{{br.num}} - {% endfor %} +{% endfor %} {% for br in c.bridges %} iface net_{{br.num}} inet static