Fix DNS Domain Name in endpoint file.
When the DNS server receives the dns domain name it includes a period in the end -- i.e. "example.com." This causes the client to think that the DNS is "bad" which is what it puts in /etc/resolv.conf file. We need to remove the period in the end of dns_domain name before the server sends the information to the client. Change-Id: Id56da2b3972fb1ce045577565b2eb7597dc7e257
This commit is contained in:
@@ -900,6 +900,7 @@ class ApicRpcHandlerMixin(object):
|
|||||||
if self.apic_optimized_dhcp_lease_time > 0:
|
if self.apic_optimized_dhcp_lease_time > 0:
|
||||||
details['dhcp_lease_time'] = self.apic_optimized_dhcp_lease_time
|
details['dhcp_lease_time'] = self.apic_optimized_dhcp_lease_time
|
||||||
details['dns_domain'] = port_info.net_dns_domain or ''
|
details['dns_domain'] = port_info.net_dns_domain or ''
|
||||||
|
details['dns_domain'] = details['dns_domain'].rstrip('.')
|
||||||
details['enable_dhcp_optimization'] = self.enable_dhcp_opt
|
details['enable_dhcp_optimization'] = self.enable_dhcp_opt
|
||||||
details['enable_metadata_optimization'] = self.enable_metadata_opt
|
details['enable_metadata_optimization'] = self.enable_metadata_opt
|
||||||
if port_info.svi:
|
if port_info.svi:
|
||||||
|
|||||||
@@ -10706,7 +10706,8 @@ class TestOpflexRpc(ApicAimTestCase):
|
|||||||
gbp_details['dhcp_lease_time'])
|
gbp_details['dhcp_lease_time'])
|
||||||
else:
|
else:
|
||||||
self.assertNotIn('dhcp_lease_time', gbp_details)
|
self.assertNotIn('dhcp_lease_time', gbp_details)
|
||||||
self.assertEqual(net['dns_domain'], gbp_details['dns_domain'])
|
self.assertEqual(net['dns_domain'].rstrip('.'),
|
||||||
|
gbp_details['dns_domain'])
|
||||||
self.assertEqual(self.driver.enable_dhcp_opt,
|
self.assertEqual(self.driver.enable_dhcp_opt,
|
||||||
gbp_details['enable_dhcp_optimization'])
|
gbp_details['enable_dhcp_optimization'])
|
||||||
self.assertEqual(self.driver.enable_metadata_opt,
|
self.assertEqual(self.driver.enable_metadata_opt,
|
||||||
|
|||||||
@@ -3512,7 +3512,7 @@ class TestPolicyTarget(AIMBaseTestCase,
|
|||||||
mapping = self.mech_driver.get_gbp_details(
|
mapping = self.mech_driver.get_gbp_details(
|
||||||
self._neutron_admin_context, device='tap%s' % port_id,
|
self._neutron_admin_context, device='tap%s' % port_id,
|
||||||
host='h1')
|
host='h1')
|
||||||
self.assertEqual('mydomain.', mapping['dns_domain'])
|
self.assertEqual('mydomain', mapping['dns_domain'])
|
||||||
req_mapping = self.mech_driver.request_endpoint_details(
|
req_mapping = self.mech_driver.request_endpoint_details(
|
||||||
nctx.get_admin_context(),
|
nctx.get_admin_context(),
|
||||||
request={'device': 'tap%s' % port_id,
|
request={'device': 'tap%s' % port_id,
|
||||||
|
|||||||
Reference in New Issue
Block a user