cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [30/50] [abbrv] git commit: updated refs/heads/feature/systemvm-persistent-config to 8620642
Date Mon, 16 Feb 2015 16:48:11 GMT
Switch control interface for vrrp to guest network
Fix rRouter that was deleting the gateway interface


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

Branch: refs/heads/feature/systemvm-persistent-config
Commit: 29705ed6dc2523831125e86f2067461eac4228f1
Parents: 89b3d2a
Author: Ian Southam <isoutham@schubergphilis.com>
Authored: Tue Feb 3 17:21:11 2015 +0100
Committer: wilderrodrigues <wrodrigues@schubergphilis.com>
Committed: Mon Feb 16 16:08:42 2015 +0100

----------------------------------------------------------------------
 .../patches/debian/config/opt/cloud/bin/cs/CsAddress.py |  4 +++-
 .../debian/config/opt/cloud/bin/cs/CsRedundant.py       | 12 +++++++-----
 2 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/29705ed6/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py
index 193c6f6..9e4e687 100644
--- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py
@@ -502,10 +502,12 @@ class CsIP:
 
     def is_guest_gateway(self, bag, ip):
         """ Exclude the vrrp maintained addresses on a redundant router """
+        interface = CsInterface(bag, self.config)
         if not self.config.cl.is_redundant():
             return False
         rip = ip.split('/')[0]
-        if bag['nw_type'] == "guest" and rip == bag['gateway']:
+        gw = interface.get_gateway()
+        if bag['nw_type'] == "guest" and rip == gw:
             return True
         return False
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/29705ed6/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 aed19d1..8561e8d 100644
--- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py
@@ -78,6 +78,11 @@ class CsRedundant(object):
         CsHelper.rm(self.KEEPALIVED_CONF)
 
     def _redundant_on(self):
+        guest = self.address.get_guest_if()
+        # No redundancy if there is no guest network
+        if guest is None:
+            self._redundant_off()
+            return
         CsHelper.mkdir(self.CS_RAMDISK_DIR, 0755, False)
         CsHelper.mount_tmpfs(self.CS_RAMDISK_DIR)
         CsHelper.mkdir(self.CS_ROUTER_DIR, 0755, False)
@@ -107,7 +112,8 @@ class CsRedundant(object):
             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)
+        file.search(" interface ", "    interface %s" % guest.get_device())
+        #file.search(" weight ", "    weight %s" % 2)
         # file.search(" state ", "    state %s" % self.cl.get_state())
         file.search(" state ", "    state %s" % "EQUAL")
         # file.search(" virtual_router_id ", "    virtual_router_id %s" % self.cl.get_router_id())
@@ -116,7 +122,6 @@ class CsRedundant(object):
         file.commit()
 
         # conntrackd configuration
-        guest = self.address.get_guest_if()
         connt = CsFile(self.CONNTRACKD_CONF)
         if guest is not None:
             connt.section("Multicast {", "}", [
@@ -136,9 +141,6 @@ class CsRedundant(object):
         if file.is_changed():
             CsHelper.service("keepalived", "restart")
 
-        # FIXME
-        # enable/disable_pubip/master/slave etc. will need rewriting to use the new python
config
-
         # Configure heartbeat cron job
         cron = CsFile("/etc/cron.d/heartbeat")
         cron.add("SHELL=/bin/bash", 0)


Mime
View raw message