[daisy] network template: Fix set inside loop
[pharos.git] / config / installers / daisy / network.yaml.j2
index 914df46..f976ab7 100644 (file)
@@ -1,5 +1,5 @@
 ##############################################################################
-# Copyright (c) 2017 ZTE Corporation and others.
+# Copyright (c) 2018 ZTE Corporation and others.
 #
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Apache License, Version 2.0
@@ -44,7 +44,7 @@ networks:
   {%- set nodes_num = conf['nodes'] | length -%}
   {%- set networks = {} -%}
   {%- for key in mapping -%}
-    {%- set net_data = conf['net_config'][mapping[key]] -%}
+    {%- set net_data = conf.idf.net_config[mapping[key]] -%}
     {%- set interface = net_data['interface'] -%}
     {%- set interface_name = conf.idf[installer].network.node[0].interfaces[interface] -%}
     {%- set bus_addr = conf.idf[installer].network.node[0].busaddr[interface] -%}
@@ -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,