Skip to content

Commit

Permalink
Merge "Closes-Bug: #1554100. Adding an extention to fetch and show DN…
Browse files Browse the repository at this point in the history
…S server address in neutron subnet-show"
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Aug 6, 2016
2 parents 766b4cd + d2e5fc4 commit e0d11d1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/config/vnc_openstack/vnc_openstack/neutron_plugin_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -1413,6 +1413,7 @@ def _subnet_neutron_to_vnc(self, subnet_q):

def _subnet_vnc_to_neutron(self, subnet_vnc, net_obj, ipam_fq_name):
sn_q_dict = {}
extra_dict = {}
sn_name = subnet_vnc.get_subnet_name()
if sn_name is not None:
sn_q_dict['name'] = sn_name
Expand Down Expand Up @@ -1472,6 +1473,15 @@ def _subnet_vnc_to_neutron(self, subnet_vnc, net_obj, ipam_fq_name):
'subnet_id': sn_id}
nameserver_dict_list.append(nameserver_entry)
sn_q_dict['dns_nameservers'] = nameserver_dict_list
# dhcp_option_list could have other options.
# Check explicitly if dns_nameservers are
# provided in the dhcp_options by the user.
# If it is NOT, then report the dns server
# allocated by contrail.
if not nameserver_dict_list:
extra_dict['contrail:dns_server_address'] = subnet_vnc.dns_server_address
if self._contrail_extensions_enabled:
sn_q_dict.update(extra_dict)

host_route_dict_list = list()
host_routes = subnet_vnc.get_host_routes()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ def _make_subnet_dict(self, subnet):
'ipv6_address_mode': subnet['ipv6_address_mode'],
'dns_nameservers': [dns['address']
for dns in subnet['dns_nameservers']],
'contrail:dns_server_address':subnet['contrail:dns_server_address'],
'host_routes': [{'destination': route['destination'],
'nexthop': route['nexthop']}
for route in subnet['routes']],
Expand Down

0 comments on commit e0d11d1

Please sign in to comment.