config/installers: Adopt j2 'do' extension 15/53015/2
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Fri, 2 Mar 2018 19:11:47 +0000 (20:11 +0100)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Sat, 3 Mar 2018 17:42:14 +0000 (18:42 +0100)
Change-Id: Iffc473a4c90ff4ee8cfbcc304a3462559199fbe0
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
config/installers/daisy/network.yaml.j2
config/installers/fuel/net_map.j2

index f976ab7..b9f586d 100644 (file)
@@ -72,18 +72,17 @@ networks:
       {%- set gateway = ".".join([ips[0], ips[1], ips[2], "1"]) -%}
     {%- endif -%}
 
-    {#- 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,
-                                              'mask': mask,
-                                              'start': start,
-                                              'end': end,
-                                              'vip': vip,
-                                              'gateway': gateway
-                                             }
-                                       }) %}
+    {%- do networks.update({key: {'interface_name': interface_name,
+                                  'bus_addr': bus_addr,
+                                  'vlan': vlan,
+                                  'network': network,
+                                  'mask': mask,
+                                  'start': start,
+                                  'end': end,
+                                  'vip': vip,
+                                  'gateway': gateway
+                                 }
+                           }) %}
 
   - cidr: '{{ network }}/{{ mask }}'
     gateway: '{{ gateway }}'
index c3ff6cb..880df20 100644 (file)
@@ -36,7 +36,7 @@
 {#- Physical interface OS name for each network (e.g. em1, enp1s0f1) #}
 {%- for role in [ctl01, cmp001] %}
     {%- set node = conf.idf.fuel.network.node[role.idx] %}
-    {%- set _ = role.update({
+    {%- do role.update({
         'nic_mcp': node.interfaces[idx_mcp],
         'nic_admin': node.interfaces[idx_admin],
         'nic_mgmt': node.interfaces[idx_mgmt],