You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ro...@apache.org on 2018/01/24 10:09:51 UTC

[cloudstack] branch 4.11 updated: CLOUDSTACK-10252: Delete dnsmasq leases file on restart (#2427)

This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch 4.11
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.11 by this push:
     new 61a5a29  CLOUDSTACK-10252: Delete dnsmasq leases file on restart (#2427)
61a5a29 is described below

commit 61a5a297058ce4478766b36d640f76684e31b9c8
Author: Rohit Yadav <ro...@apache.org>
AuthorDate: Wed Jan 24 11:09:45 2018 +0100

    CLOUDSTACK-10252: Delete dnsmasq leases file on restart (#2427)
    
    Delete dnsmasq's leases file when dnsmasq is restarted to avoid it
    use old ip-mac-address-vm mapping leases.
    
    Signed-off-by: Rohit Yadav <ro...@shapeblue.com>
---
 systemvm/debian/opt/cloud/bin/cs/CsDhcp.py | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/systemvm/debian/opt/cloud/bin/cs/CsDhcp.py b/systemvm/debian/opt/cloud/bin/cs/CsDhcp.py
index 7aac837..30fb38e 100755
--- a/systemvm/debian/opt/cloud/bin/cs/CsDhcp.py
+++ b/systemvm/debian/opt/cloud/bin/cs/CsDhcp.py
@@ -49,15 +49,21 @@ class CsDhcp(CsDataBag):
             self.add(self.dbag[item])
         self.write_hosts()
 
-        if self.cloud.is_changed():
-            self.delete_leases()
-
         self.configure_server()
 
-        restart_dnsmasq = self.conf.commit()
-        self.cloud.commit()
+        restart_dnsmasq = False
+
+        if self.conf.commit():
+            restart_dnsmasq = True
+
+        if self.cloud.commit():
+            restart_dnsmasq = True
+
         self.dhcp_opts.commit()
 
+        if restart_dnsmasq:
+            self.delete_leases()
+
         if not self.cl.is_redundant() or self.cl.is_master():
             if restart_dnsmasq:
                 CsHelper.service("dnsmasq", "restart")

-- 
To stop receiving notification emails like this one, please contact
rohit@apache.org.