Ensure that network.device type exists before using it
When passing an empty external network definition for the undercloud, it was failing because it was assuming to have values and a device type. Check if that exists before using it Change-Id: I6b573485d373219d257b8c34a252d8490a4c09a0 Fixes-Bug: #1720796
This commit is contained in:
parent
5e1463d84a
commit
580c8ab543
|
@ -47,7 +47,7 @@ echo "Please use 'single-nic-vlans' and 'bond-with-vlans'"
|
|||
{% endif %}
|
||||
{% for name, network in (undercloud_networks|default({})).items() if name == 'external' %}
|
||||
|
||||
{% if not overcloud_ipv6|bool and network.device_type == 'ovs' %}
|
||||
{% if not overcloud_ipv6|bool and network.device_type is defined and network.device_type == 'ovs' %}
|
||||
sudo bash -c 'cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-vlan{{ network.tag }}
|
||||
DEVICE=vlan{{ network.tag }}
|
||||
ONBOOT=yes
|
||||
|
@ -62,7 +62,7 @@ EOF'
|
|||
|
||||
sudo ifup ifcfg-vlan{{ network.tag }}
|
||||
|
||||
{% elif network.device_type == 'ethernet' %}
|
||||
{% elif network.device_type is defined and network.device_type == 'ethernet' %}
|
||||
|
||||
sudo bash -c 'cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-{{ network.device_name }}
|
||||
DEVICE={{ network.device_name }}
|
||||
|
|
Loading…
Reference in New Issue