mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-8915 - Copy the conntrackd configuration every time _redundant_on() function is called
- Also refactored the copy() function under CsHelper.py
This commit is contained in:
parent
a0c93e7778
commit
9fe040e96d
|
|
@ -213,12 +213,7 @@ def copy_if_needed(src, dest):
|
|||
"""
|
||||
if os.path.isfile(dest):
|
||||
return
|
||||
try:
|
||||
shutil.copy2(src, dest)
|
||||
except IOError:
|
||||
logging.Error("Could not copy %s to %s" % (src, dest))
|
||||
else:
|
||||
logging.info("Copied %s to %s" % (src, dest))
|
||||
copy(src, dest)
|
||||
|
||||
def copy(src, dest):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -99,10 +99,12 @@ class CsRedundant(object):
|
|||
|
||||
CsHelper.copy_if_needed(
|
||||
"%s/%s" % (self.CS_TEMPLATES_DIR, "keepalived.conf.templ"), self.KEEPALIVED_CONF)
|
||||
CsHelper.copy_if_needed(
|
||||
"%s/%s" % (self.CS_TEMPLATES_DIR, "conntrackd.conf.templ"), self.CONNTRACKD_CONF)
|
||||
CsHelper.copy_if_needed(
|
||||
"%s/%s" % (self.CS_TEMPLATES_DIR, "checkrouter.sh.templ"), "/opt/cloud/bin/checkrouter.sh")
|
||||
#The file is always copied so the RVR doesn't't get the wrong config.
|
||||
#Concerning the r-VPC, the configuration will be applied in a different manner
|
||||
CsHelper.copy(
|
||||
"%s/%s" % (self.CS_TEMPLATES_DIR, "conntrackd.conf.templ"), self.CONNTRACKD_CONF)
|
||||
|
||||
CsHelper.execute(
|
||||
'sed -i "s/--exec\ \$DAEMON;/--exec\ \$DAEMON\ --\ --vrrp;/g" /etc/init.d/keepalived')
|
||||
|
|
|
|||
Loading…
Reference in New Issue