Don't extract dns_name when not set

If the networks dns_name is None, do not set dns_name
entry in the vip data YAML file with "null" value.

Change-Id: I62662cb5ad5176b20427e057d1b4c4fcad12688e
(cherry picked from commit 16c7d68300)
This commit is contained in:
Juan Badia Payno
2022-04-28 14:57:29 +02:00
committed by Harald Jensås
parent ea952635e9
commit 42af71756f

View File

@@ -106,11 +106,17 @@ def update_vip_data(conn, network, vip_ports, vip_data):
return
subnet = conn.network.get_subnet(vip.fixed_ips[0]['subnet_id'])
vip_data.append(dict(name=vip.name,
network=network.name,
subnet=subnet.name,
ip_address=vip.fixed_ips[0]['ip_address'],
dns_name=vip.dns_name))
if (vip.dns_name is not None):
vip_data.append(dict(name=vip.name,
network=network.name,
subnet=subnet.name,
ip_address=vip.fixed_ips[0]['ip_address'],
dns_name=vip.dns_name))
else:
vip_data.append(dict(name=vip.name,
network=network.name,
subnet=subnet.name,
ip_address=vip.fixed_ips[0]['ip_address']))
def find_net_vips(conn, net_resrcs, vip_data):