cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject [3/6] git commit: updated refs/heads/master to b29d8e7
Date Thu, 16 Jul 2015 11:16:04 GMT
CLOUDSTACK-8616 - Installing KeepaliveD from Debian Wheezy backports

   - preempt delay reverted on version 1.2.13 - from the backports
     - vrrp : Revert "Honor preempt_delay setting on startup.".
     - See changelog: http://www.keepalived.org/changelog.html
   - Refactoring some variable names to avoid misunderstanding

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>


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

Branch: refs/heads/master
Commit: f78a65c05aa14a3d205ddb15d9b59a6792e810ad
Parents: 12ee36a
Author: wilderrodrigues <wrodrigues@schubergphilis.com>
Authored: Fri Jul 10 08:41:28 2015 +0200
Committer: wilderrodrigues <wrodrigues@schubergphilis.com>
Committed: Thu Jul 16 13:14:48 2015 +0200

----------------------------------------------------------------------
 systemvm/patches/debian/buildsystemvm.sh        |  6 ++--
 .../debian/config/opt/cloud/bin/cs/CsFile.py    |  4 +--
 .../config/opt/cloud/bin/cs/CsRedundant.py      | 31 ++++++++------------
 3 files changed, 19 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f78a65c0/systemvm/patches/debian/buildsystemvm.sh
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/buildsystemvm.sh b/systemvm/patches/debian/buildsystemvm.sh
index 0250eec..b724b29 100755
--- a/systemvm/patches/debian/buildsystemvm.sh
+++ b/systemvm/patches/debian/buildsystemvm.sh
@@ -375,8 +375,10 @@ packages() {
   chroot . apt-get --no-install-recommends -q -y --force-yes install open-vm-tools
   #xenstore utils
   chroot . apt-get --no-install-recommends -q -y --force-yes install xenstore-utils libxenstore3.0
-  #keepalived and conntrackd
-  chroot . apt-get --no-install-recommends -q -y --force-yes install keepalived conntrackd
ipvsadm libnetfilter-conntrack3 libnl1
+  #keepalived - install version 1.2.13 from wheezy backports
+  chroot . apt-get --no-install-recommends -t wheezy-backports -q -y --force-yes install
keepalived
+  #conntrackd
+  chroot . apt-get --no-install-recommends -q -y --force-yes install conntrackd ipvsadm libnetfilter-conntrack3
libnl1
   #ipcalc
   chroot . apt-get --no-install-recommends -q -y --force-yes install ipcalc
   #irqbalance from wheezy-backports

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f78a65c0/systemvm/patches/debian/config/opt/cloud/bin/cs/CsFile.py
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsFile.py b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsFile.py
index 6195f4e..28d4413 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsFile.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsFile.py
@@ -35,10 +35,9 @@ class CsFile:
                 self.new_config.append(line)
         except IOError:
             logging.debug("File %s does not exist" % self.filename)
-            return
         else:
             logging.debug("Reading file %s" % self.filename)
-            self.config = copy.deepcopy(self.new_config)
+            self.config = list(self.new_config)
 
     def is_changed(self):
         if set(self.config) != set(self.new_config):
@@ -58,6 +57,7 @@ class CsFile:
 
     def commit(self):
         if not self.is_changed():
+            logging.info("Nothing to commit. The %s file did not change" % self.filename)
             return
         handle = open(self.filename, "w+")
         for line in self.new_config:

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f78a65c0/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 f2ab09c..9a98376 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py
@@ -101,21 +101,19 @@ class CsRedundant(object):
 
         CsHelper.execute('sed -i "s/--exec\ \$DAEMON;/--exec\ \$DAEMON\ --\ --vrrp;/g" /etc/init.d/keepalived')
         # checkrouter.sh configuration
-        file = CsFile("/opt/cloud/bin/checkrouter.sh")
-        file.greplace("[RROUTER_LOG]", self.RROUTER_LOG)
-        file.commit()
+        check_router = CsFile("/opt/cloud/bin/checkrouter.sh")
+        check_router.greplace("[RROUTER_LOG]", self.RROUTER_LOG)
+        check_router.commit()
 
         # keepalived configuration
-        file = CsFile(self.KEEPALIVED_CONF)
-        ads = [o for o in self.address.get_ips() if o.is_public()]
-            
-        file.search(" router_id ", "    router_id %s" % self.cl.get_name())
-        file.search(" interface ", "    interface %s" % guest.get_device())
-        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("virtual_ipaddress {", "}", self._collect_ips())
-        file.commit()
+        keepalived_conf = CsFile(self.KEEPALIVED_CONF)
+        keepalived_conf.search(" router_id ", "    router_id %s" % self.cl.get_name())
+        keepalived_conf.search(" interface ", "    interface %s" % guest.get_device())
+        keepalived_conf.search(" virtual_router_id ", "    virtual_router_id %s" % self.cl.get_router_id())
+        keepalived_conf.greplace("[RROUTER_BIN_PATH]", self.CS_ROUTER_DIR)
+        keepalived_conf.section("authentication {", "}", ["        auth_type AH \n", "  
     auth_pass %s\n" % self.cl.get_router_password()])
+        keepalived_conf.section("virtual_ipaddress {", "}", self._collect_ips())
+        keepalived_conf.commit()
 
         # conntrackd configuration
         connt = CsFile(self.CONNTRACKD_CONF)
@@ -134,9 +132,6 @@ class CsRedundant(object):
         if connt.is_changed():
             CsHelper.service("conntrackd", "restart")
 
-        if file.is_changed():
-            CsHelper.service("keepalived", "reload")
-
         # Configure heartbeat cron job - runs every 30 seconds
         heartbeat_cron = CsFile("/etc/cron.d/heartbeat")
         heartbeat_cron.add("SHELL=/bin/bash", 0)
@@ -153,8 +148,8 @@ class CsRedundant(object):
         keepalived_cron.commit()
 
         proc = CsProcess(['/usr/sbin/keepalived', '--vrrp'])
-        if not proc.find():
-            CsHelper.service("keepalived", "start")
+        if not proc.find() or keepalived_conf.is_changed():
+            CsHelper.service("keepalived", "restart")
 
     def release_lock(self):
         try:


Mime
View raw message