Skip to content

CLOUDSTACK-10252: Delete dnsmasq leases file on restart #2427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 24, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions systemvm/debian/opt/cloud/bin/cs/CsDhcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repeat 2 times commit, why?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@resmo The commit is called on two different files, it's the same old code refactored differently.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see conf.commit and cloud.commit. Those are two different objects, @resmo . How is this suspect?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed that. never mind.

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")
Expand Down