summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-01-24 22:47:52 +0100
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-01-28 18:59:18 +0100
commit9cd019d3af46e492b374534d2b5b9bfd6528688e (patch)
tree9e4ac9f5759758afa5069f38ff52973b2db1ec1f
parentf666a4aaaefb41c93c2ccc36987b3f2dabb0e7d2 (diff)
[daisy] network template: Fix set inside loop
Previous implementation fails in older versions of py-jinja2. See related bug reports [1, 2]. Since `networks.update` on its own is enough, stop assigning its result back to 'networks'. [1] https://github.com/pallets/jinja/issues/641 [2] https://github.com/pallets/jinja/issues/164 Change-Id: I303388223bdec9ae43e49d988aee41b5b47c1562 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
-rw-r--r--config/installers/daisy/network.yaml.j23
1 files changed, 2 insertions, 1 deletions
diff --git a/config/installers/daisy/network.yaml.j2 b/config/installers/daisy/network.yaml.j2
index 1fad1ac..f976ab7 100644
--- a/config/installers/daisy/network.yaml.j2
+++ b/config/installers/daisy/network.yaml.j2
@@ -72,7 +72,8 @@ networks:
{%- set gateway = ".".join([ips[0], ips[1], ips[2], "1"]) -%}
{%- endif -%}
- {%- set networks = networks.update({key: {'interface_name': interface_name,
+ {#- set v=v.update(...) is unpredictable and breaks in older j2 -#}
+ {%- set _ = networks.update({key: {'interface_name': interface_name,
'bus_addr': bus_addr,
'vlan': vlan,
'network': network,