[daisy] network template: Fix set inside loop 77/51077/3
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Wed, 24 Jan 2018 21:47:52 +0000 (22:47 +0100)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Sun, 28 Jan 2018 17:59:18 +0000 (18:59 +0100)
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>
config/installers/daisy/network.yaml.j2

index 1fad1ac..f976ab7 100644 (file)
@@ -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,