rhtyd closed pull request #2427: CLOUDSTACK-10252: Delete dnsmasq leases file
on restart
URL: https://github.com/apache/cloudstack/pull/2427
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/CsDhcp.py
b/systemvm/debian/opt/cloud/bin/cs/CsDhcp.py
index 7aac837cf1b..30fb38e016a 100755
--- a/systemvm/debian/opt/cloud/bin/cs/CsDhcp.py
+++ b/systemvm/debian/opt/cloud/bin/cs/CsDhcp.py
@@ -49,15 +49,21 @@ def process(self):
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")
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services