Skip to content

Commit

Permalink
Control data interface should only be used when role is vrouter or co…
Browse files Browse the repository at this point in the history
…ntrol

This is as per the latest implementation of contrail-ansible-deployer provisinoning.

Making a temporary quick fix to run sanity till the implementation is finalised
Closes-bug: #1774663

Change-Id: If1d5553b1243ddc9796398e60cd559e436d8af33
  • Loading branch information
pulkitt committed Jun 1, 2018
1 parent e8cc63c commit f330a00
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions common/contrail_test_init.py
Expand Up @@ -564,6 +564,16 @@ def _get_ip_for_service(self, host, service):
host_dict = self.host_data[host]
if service.lower() == 'vrouter':
return self.get_ips_of_host(host, 'vhost0')[0]
elif service.lower() == 'control':
ip_list = self.contrail_configs.get('CONTROL_NODES')
if not ip_list:
return
else:
ips = self.get_ips_of_host(host)
for ip in ip_list.split(','):
if ip in ips:
self.host_data[host]['control_data_ip'] = ip
return ip
elif service.lower() == 'openstack':
nic = host_dict['roles']['openstack'].get('network_interface') \
if host_dict['roles']['openstack'] else \
Expand Down Expand Up @@ -695,6 +705,7 @@ def parse_topo(self):
self.bgp_ips.append(host_data['host_ip'])
self.bgp_control_ips.append(service_ip)
self.bgp_names.append(hostname)
host_data_ip = host_control_ip = service_ip
if 'webui' in roles:
service_ip = self.get_service_ip(host_data['host_ip'], 'webui')
self.webui_ip = host_data['host_ip']
Expand Down

0 comments on commit f330a00

Please sign in to comment.