##############################################################################
-# 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
{%- set installer = "fuel" -%}
{%- endif %}
-{%- if conf.net_config is defined -%}
- {%- set conf_net_config = conf.net_config -%}
-{%- elif conf.idf.net_config is defined -%}
- {%- set conf_net_config = conf.idf.net_config -%}
-{%- endif %}
-
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] -%}
{%- 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,