cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [1/5] git commit: updated refs/heads/master to be41921
Date Tue, 13 Oct 2015 20:39:15 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master f0cd632d5 -> be419211e


CLOUDSTACK-8934 - Add default gateway when the public interface is up again


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

Branch: refs/heads/master
Commit: 45642b83821ce0ecd6d4cddb76a77a2481e54d9a
Parents: ca9e934
Author: Wilder Rodrigues <wrodrigues@schubergphilis.com>
Authored: Thu Oct 8 14:19:26 2015 +0200
Committer: Wilder Rodrigues <wrodrigues@schubergphilis.com>
Committed: Sun Oct 11 14:57:12 2015 +0200

----------------------------------------------------------------------
 .../debian/config/opt/cloud/bin/cs/CsAddress.py |  8 +++---
 .../config/opt/cloud/bin/cs/CsRedundant.py      | 21 +++++++++++----
 .../patches/debian/config/opt/cloud/bin/ian.py  | 27 --------------------
 .../integration/component/test_vpc_redundant.py |  5 ++--
 4 files changed, 23 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/45642b83/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 78ccb3a..074a63f 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsAddress.py
@@ -155,7 +155,7 @@ class CsInterface:
         return self.get_attr("netmask")
 
     def get_gateway(self):
-        if self.config.is_vpc():
+        if self.config.is_vpc() or self.config.cmdline().is_redundant():
             return self.get_attr("gateway")
         else:
             return self.config.cmdline().get_guest_gw()
@@ -308,7 +308,7 @@ class CsIP:
         if not self.config.is_vpc():
             self.setup_router_control()
         
-        if self.config.is_vpc():
+        if self.config.is_vpc() or self.cl.is_redundant():
             # 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.
@@ -329,10 +329,10 @@ class CsIP:
                 cmd2 = "ip link set %s up" % self.getDevice()
                 # If redundant do not bring up public interfaces
                 # master.py and keepalived deal with tham
-                if self.config.cmdline().is_redundant() and not self.is_public():
+                if self.cl.is_redundant() and not self.is_public():
                     CsHelper.execute(cmd2)
                 # if not redundant bring everything up
-                if not self.config.cmdline().is_redundant():
+                if not self.cl.is_redundant():
                     CsHelper.execute(cmd2)
 
     def set_mark(self):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/45642b83/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 0f71673..abe997c 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py
@@ -37,6 +37,7 @@ from CsFile import CsFile
 from CsProcess import CsProcess
 from CsApp import CsPasswdSvc
 from CsAddress import CsDevice
+from CsRoute import CsRoute
 import socket
 from time import sleep
 
@@ -267,16 +268,26 @@ class CsRedundant(object):
 
         ads = [o for o in self.address.get_ips() if o.is_public()]
         dev = ''
+        route = CsRoute()
         for o in ads:
             if dev == o.get_device():
                 continue
-            cmd2 = "ip link set %s up" % o.get_device()
-            if CsDevice(o.get_device(), self.config).waitfordevice():
+            dev = o.get_device()
+            logging.info("Will proceed configuring device ==> %s" % dev)
+            cmd2 = "ip link set %s up" % dev
+            if CsDevice(dev, self.config).waitfordevice():
                 CsHelper.execute(cmd2)
-                dev = o.get_device()
-                logging.info("Bringing public interface %s up" % o.get_device())
+                logging.info("Bringing public interface %s up" % dev)
+
+                try:
+                    gateway = o.get_gateway()
+                    logging.info("Adding gateway ==> %s to device ==> %s" % (gateway,
dev))
+                    route.add_defaultroute(gateway)
+                except:
+                    logging.error("ERROR getting gateway from device %s" % dev)
+                    
             else:
-                logging.error("Device %s was not ready could not bring it up" % o.get_device())
+                logging.error("Device %s was not ready could not bring it up" % dev)
 
         # ip route add default via $gw table Table_$dev proto static
         cmd = "%s -C %s" % (self.CONNTRACKD_BIN, self.CONNTRACKD_CONF)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/45642b83/systemvm/patches/debian/config/opt/cloud/bin/ian.py
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/ian.py b/systemvm/patches/debian/config/opt/cloud/bin/ian.py
deleted file mode 100644
index 186c594..0000000
--- a/systemvm/patches/debian/config/opt/cloud/bin/ian.py
+++ /dev/null
@@ -1,27 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-from cs.CsGuestNetwork import CsGuestNetwork
-import merge
-
-merge.DataBag.DPATH = "."
-csguestnetwork = CsGuestNetwork({}, {})
-csguestnetwork.guest = True
-csguestnetwork.set_dns("1.1.1.1,2.2.2.2")
-csguestnetwork.set_router("3.3.3.3")
-dns = csguestnetwork.get_dns()
-print dns

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/45642b83/test/integration/component/test_vpc_redundant.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_vpc_redundant.py b/test/integration/component/test_vpc_redundant.py
index 11fabf6..6f82aec 100644
--- a/test/integration/component/test_vpc_redundant.py
+++ b/test/integration/component/test_vpc_redundant.py
@@ -462,7 +462,8 @@ class TestVPCRedundancy(cloudstackTestCase):
         self.check_master_status(2)
         self.add_nat_rules()
         self.do_vpc_test(False)
-
+        time.sleep(30)
+        
         self.stop_router_by_type("MASTER")
         # wait for the backup router to transit to master state
         time.sleep(30)
@@ -476,7 +477,7 @@ class TestVPCRedundancy(cloudstackTestCase):
 
         self.start_routers()
         self.add_nat_rules()
-        time.sleep(45)
+        time.sleep(30)
         self.check_master_status(2)
         self.do_vpc_test(False)
 


Mime
View raw message