You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2015/03/17 11:26:16 UTC

[14/50] git commit: updated refs/heads/master to 3c429ee

Restart keepalived if a pub interface gets added or removed


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

Branch: refs/heads/master
Commit: db48a9967841130a5248f764380eca29a0f46fa2
Parents: 159088c
Author: Ian Southam <is...@schubergphilis.com>
Authored: Thu Jan 29 15:50:36 2015 +0100
Committer: wilderrodrigues <wr...@schubergphilis.com>
Committed: Mon Mar 16 11:39:55 2015 +0100

----------------------------------------------------------------------
 .../debian/config/opt/cloud/bin/cs/CsRedundant.py        | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/db48a996/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 2fa4160..aed19d1 100644
--- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py
@@ -98,6 +98,13 @@ class CsRedundant(object):
 
         # keepalived configuration
         file = CsFile(self.KEEPALIVED_CONF)
+        ads = [o for o in self.address.get_ips() if o.is_public()]
+        # Add a comment for each public IP.  If any change this will cause keepalived to restart
+        # As things stand keepalived will be configured before the IP is added or deleted
+        i = 0
+        for o in ads:
+            file.addeq("! %s=%s" % (i, o.get_cidr()))
+            i = i + 1
         file.search(" router_id ", "    router_id %s" % self.cl.get_name())
         file.search(" priority ", "    priority %s" % self.cl.get_priority())
         file.search(" weight ", "    weight %s" % 2)
@@ -105,11 +112,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)
-# If there is no guest network still bring up the public interface
-# Maybe necessary for things like VPNs and private gateways
         file.section("virtual_ipaddress {", "}", self._collect_ips())
-        # if self.cl.get_state() == 'MASTER':
-            # file.search(" priority ", "    priority %s" % 100)
         file.commit()
 
         # conntrackd configuration