cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [01/13] git commit: updated refs/heads/master to 6fe5ae0
Date Tue, 20 Oct 2015 06:01:06 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 0827e1f85 -> 6fe5ae0d6


CLOUDSTACK-8952 - Do not replace the conntrackd config file unless it's needed

   - With the new logic, the file will be replaced when the router starts, becasue the default
     conntrackd config file will be different.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/5a216056
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/5a216056
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/5a216056

Branch: refs/heads/master
Commit: 5a216056b5a325b8abbe6f7c20f98caf202a27bc
Parents: 08b983f
Author: Wilder Rodrigues <wrodrigues@schubergphilis.com>
Authored: Wed Oct 14 14:13:24 2015 +0200
Committer: Wilder Rodrigues <wrodrigues@schubergphilis.com>
Committed: Sat Oct 17 12:20:39 2015 +0200

----------------------------------------------------------------------
 .../config/opt/cloud/bin/cs/CsRedundant.py      | 21 ++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5a216056/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py
index cdc66d8..5361c33 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py
@@ -102,10 +102,6 @@ class CsRedundant(object):
             "%s/%s" % (self.CS_TEMPLATES_DIR, "keepalived.conf.templ"), self.KEEPALIVED_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')
@@ -130,7 +126,12 @@ class CsRedundant(object):
         keepalived_conf.commit()
 
         # conntrackd configuration
-        connt = CsFile(self.CONNTRACKD_CONF)
+        conntrackd_template_conf = "%s/%s" % (self.CS_TEMPLATES_DIR, "conntrackd.conf.templ")
+        conntrackd_temp_bkp = "%s/%s" % (self.CS_TEMPLATES_DIR, "conntrackd.conf.templ.bkp")
+        
+        CsHelper.copy(conntrackd_template_conf, conntrackd_temp_bkp)
+        
+        connt = CsFile(conntrackd_template_conf)
         if guest is not None:
             connt.section("Multicast {", "}", [
                           "IPv4_address 225.0.0.50\n",
@@ -143,9 +144,17 @@ class CsRedundant(object):
             connt.section("Address Ignore {", "}", self._collect_ignore_ips())
             connt.commit()
 
-        if connt.is_changed():
+        conntrackd_conf = CsFile(self.CONNTRACKD_CONF)
+
+        if not connt.compare(conntrackd_conf):
+            CsHelper.copy(conntrackd_template_conf, self.CONNTRACKD_CONF)
+            proc = CsProcess(['/etc/conntrackd/conntrackd.conf'])
             CsHelper.service("conntrackd", "restart")
 
+        # Restore the template file and remove the backup.
+        CsHelper.copy(conntrackd_temp_bkp, conntrackd_template_conf)
+        CsHelper.execute("rm -rf %s" % conntrackd_temp_bkp)
+
         # Configure heartbeat cron job - runs every 30 seconds
         heartbeat_cron = CsFile("/etc/cron.d/heartbeat")
         heartbeat_cron.add("SHELL=/bin/bash", 0)


Mime
View raw message