You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2018/01/09 19:11:59 UTC

[GitHub] rhtyd closed pull request #2393: CLOUDSTACK-10217: Clean up old MAC addresses from DHCP lease file

rhtyd closed pull request #2393: CLOUDSTACK-10217: Clean up old MAC addresses from DHCP lease file
URL: https://github.com/apache/cloudstack/pull/2393
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/systemvm/debian/opt/cloud/bin/cs_dhcp.py b/systemvm/debian/opt/cloud/bin/cs_dhcp.py
index b85e650d90a..88b4b7568c5 100755
--- a/systemvm/debian/opt/cloud/bin/cs_dhcp.py
+++ b/systemvm/debian/opt/cloud/bin/cs_dhcp.py
@@ -25,12 +25,18 @@ def merge(dbag, data):
         if data['ipv4_address'] in dbag:
             del(dbag[data['ipv4_address']])
     else:
-        remove_key = None
+        remove_keys = set()
         for key, entry in dbag.iteritems():
             if key != 'id' and entry['host_name'] == data['host_name']:
-                remove_key = key
+                remove_keys.add(key)
                 break
-        if remove_key is not None:
+
+        for key, entry in dbag.iteritems():
+            if key != 'id' and entry['mac_address'] == data['mac_address']:
+                remove_keys.add(key)
+                break
+
+        for remove_key in remove_keys:
             del(dbag[remove_key])
 
         dbag[data['ipv4_address']] = data


 

----------------------------------------------------------------
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