You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by gi...@git.apache.org on 2017/05/15 08:50:21 UTC

[GitHub] niteshsarda commented on a change in pull request #2082: CLOUDSTACK-9017 : VPC VR DHCP broken for multihomed guest VMs

niteshsarda commented on a change in pull request #2082: CLOUDSTACK-9017 : VPC VR DHCP broken for multihomed guest VMs
URL: https://github.com/apache/cloudstack/pull/2082#discussion_r116439166
 
 

 ##########
 File path: systemvm/patches/debian/config/opt/cloud/bin/cs_dhcp.py
 ##########
 @@ -34,16 +34,14 @@ def merge(dbag, data):
     return dbag
 
 
-def search(dbag, name):
+def search(dbag, name, gateway):
     """
     Dirty hack because CS does not deprovision hosts
     """
     hosts = []
     for o in dbag:
         if o == 'id':
             continue
-        print "%s %s" % (dbag[o]['host_name'], name)
-        if dbag[o]['host_name'] == name:
+        print "%s %s %s" % (dbag[o]['host_name'], name, gateway)
+        if dbag[o]['host_name'] == name and dbag[o]['default_gateway'] == gateway :
             hosts.append(o)
-    for o in hosts:
 
 Review comment:
   @ustcweizhou @rhtyd I have removed this code because while testing the fix, I have found that without removing this lines, fix will work for two network of same VPC but as soon as third network from same VPC is added, it will behave differently.
   Here, different behavior means, default NIC and latest added NIC will get the IP from DHCP, whereas other networks did not receive IP from DHCP. Removing this two lines solves the issue, whereas I have not tested the code by removing search method altogether. 
   
   Let me know, if I need to remove whole search method.  
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services