← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1893802] [NEW] Get domain name for dhcp from neutron db

 

Public bug reported:

Neutron maintains a dns_domain entry for networks, but the record is not
used as a domain in dhcp options


This patch added support domain name in dhcp options.

diff --git a/neutron/agent/linux/dhcp.py b/neutron/agent/linux/dhcp.py
index c2fed93a82..cb37e7826c 100644
--- a/neutron/agent/linux/dhcp.py
+++ b/neutron/agent/linux/dhcp.py
@@ -465,8 +465,12 @@ class Dnsmasq(DhcpLocalProcess):
         for server in self.conf.dnsmasq_dns_servers:
             cmd.append('--server=%s' % server)
 
-        if self.conf.dns_domain:
-            cmd.append('--domain=%s' % self.conf.dns_domain)
+        if self.network.dns_domain:
+            cmd.append('--domain=%s' % self.network.dns_domain)
+
+        if self.network.dns_domain == None or self.network.dns_domain == "" :
+            if self.conf.dns_domain:
+                cmd.append('--domain=%s' % self.conf.dns_domain)
 
         if self.conf.dhcp_broadcast_reply:
             cmd.append('--dhcp-broadcast')

What should I do to send to upstream?

** Affects: neutron
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1893802

Title:
  Get domain name for dhcp from neutron db

Status in neutron:
  New

Bug description:
  Neutron maintains a dns_domain entry for networks, but the record is
  not used as a domain in dhcp options

  
  This patch added support domain name in dhcp options.

  diff --git a/neutron/agent/linux/dhcp.py b/neutron/agent/linux/dhcp.py
  index c2fed93a82..cb37e7826c 100644
  --- a/neutron/agent/linux/dhcp.py
  +++ b/neutron/agent/linux/dhcp.py
  @@ -465,8 +465,12 @@ class Dnsmasq(DhcpLocalProcess):
           for server in self.conf.dnsmasq_dns_servers:
               cmd.append('--server=%s' % server)
   
  -        if self.conf.dns_domain:
  -            cmd.append('--domain=%s' % self.conf.dns_domain)
  +        if self.network.dns_domain:
  +            cmd.append('--domain=%s' % self.network.dns_domain)
  +
  +        if self.network.dns_domain == None or self.network.dns_domain == "" :
  +            if self.conf.dns_domain:
  +                cmd.append('--domain=%s' % self.conf.dns_domain)
   
           if self.conf.dhcp_broadcast_reply:
               cmd.append('--dhcp-broadcast')

  What should I do to send to upstream?

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1893802/+subscriptions