cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sw...@apache.org
Subject [04/11] git commit: updated refs/heads/4.7 to 309a60e
Date Thu, 12 May 2016 15:01:21 GMT
CLOUDSTACK-9287 - Make sure private gw interface is not used for default gw


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

Branch: refs/heads/4.7
Commit: 057b54aa3e8a462b3ced9b53d7a55dd5a64a0e4e
Parents: 250be37
Author: Remi Bergsma <github@remi.nl>
Authored: Sun Feb 14 14:39:53 2016 +0100
Committer: Remi Bergsma <github@remi.nl>
Committed: Sat Apr 9 21:13:47 2016 +0200

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/057b54aa/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 41b5e9a..f74ff47 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py
@@ -307,7 +307,7 @@ class CsIP:
             # The code looks redundant here, but we actually have to cater for routers and
             # VPC routers in a different manner. Please do not remove this block otherwise
             # The VPC default route will be broken.
-            if self.get_type() in ["public"]:
+            if self.get_type() in ["public"] and address["device"] in PUBLIC_INTERFACE:
                 gateway = str(address["gateway"])
                 route.add_defaultroute(gateway)
         else:

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/057b54aa/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 77d0a6b..92f27ce 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py
@@ -41,6 +41,7 @@ from CsRoute import CsRoute
 import socket
 from time import sleep
 
+PUBLIC_INTERFACE = ['eth0', 'eth1']
 
 class CsRedundant(object):
 
@@ -228,7 +229,7 @@ class CsRedundant(object):
         self.set_lock()
         logging.info("Router switched to fault mode")
 
-        ips = [ip for ip in self.address.get_ips() if ip.is_public()]
+        ips = [ip for ip in self.address.get_ips() if ip.is_public() and ip.get_device()
in PUBLIC_INTERFACE]
         for ip in ips:
             CsHelper.execute("ifconfig %s down" % ip.get_device())
 
@@ -257,7 +258,7 @@ class CsRedundant(object):
         logging.debug("Setting router to backup")
 
         dev = ''
-        ips = [ip for ip in self.address.get_ips() if ip.is_public()]
+        ips = [ip for ip in self.address.get_ips() if ip.is_public() and ip.get_device()
in PUBLIC_INTERFACE]
         for ip in ips:
             if dev == ip.get_device():
                 continue
@@ -291,7 +292,7 @@ class CsRedundant(object):
         logging.debug("Setting router to master")
 
         dev = ''
-        ips = [ip for ip in self.address.get_ips() if ip.is_public()]
+        ips = [ip for ip in self.address.get_ips() if ip.is_public() and ip.get_device()
in PUBLIC_INTERFACE]
         route = CsRoute()
         for ip in ips:
             if dev == ip.get_device():


Mime
View raw message