mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
dnsmasq should restart if config changes and hup if hosts change
This commit is contained in:
parent
962a62ed5f
commit
7700e940ff
@ -132,7 +132,7 @@ class CsCmdLine(CsDataBag):
|
||||
def get_router_password(self):
|
||||
if "router_password" in self.idata():
|
||||
return self.idata()['router_password']
|
||||
|
||||
|
||||
'''
|
||||
Generate a password based on the router id just to avoid hard-coded passwd.
|
||||
Remark: if for some reason 1 router gets configured, the other one will have a different password.
|
||||
|
||||
@ -47,11 +47,10 @@ class CsDhcp(CsDataBag):
|
||||
self.configure_server()
|
||||
self.conf.commit()
|
||||
self.cloud.commit()
|
||||
if self.cloud.is_changed():
|
||||
if length < 2:
|
||||
CsHelper.service("dnsmasq", "restart")
|
||||
else:
|
||||
CsHelper.hup_dnsmasq("dnsmasq", "dnsmasq")
|
||||
if self.conf.is_changed():
|
||||
CsHelper.service("dnsmasq", "restart")
|
||||
elif self.cloud.is_changed():
|
||||
CsHelper.hup_dnsmasq("dnsmasq", "dnsmasq")
|
||||
|
||||
def configure_server(self):
|
||||
# self.conf.addeq("dhcp-hostsfile=%s" % DHCP_HOSTS)
|
||||
|
||||
@ -122,7 +122,7 @@ class CsRedundant(object):
|
||||
file.search(" state ", " state %s" % "EQUAL")
|
||||
file.search(" virtual_router_id ", " virtual_router_id %s" % self.cl.get_router_id())
|
||||
file.greplace("[RROUTER_BIN_PATH]", self.CS_ROUTER_DIR)
|
||||
file.section("authentication {", "}", [ " auth_type AH \n", " auth_pass %s\n" % self.cl.get_router_password()] )
|
||||
file.section("authentication {", "}", [" auth_type AH \n", " auth_pass %s\n" % self.cl.get_router_password()])
|
||||
file.section("virtual_ipaddress {", "}", self._collect_ips())
|
||||
file.commit()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user