From 606d41c0b2287cc3b9ee944ae8f0ca68f013d848 Mon Sep 17 00:00:00 2001 From: Remi Bergsma Date: Fri, 8 Jul 2016 14:49:07 +0200 Subject: [PATCH] First set state to master, then apply static routes Static routes are only appied on the master and when there is none set it won't process them. --- .../debian/config/opt/cloud/bin/cs/CsRedundant.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cosmic-core/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py b/cosmic-core/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py index 579685d31c..019bbfefd1 100755 --- a/cosmic-core/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py +++ b/cosmic-core/systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py @@ -308,10 +308,6 @@ def set_master(self): else: logging.error("Device %s was not ready could not bring it up" % dev) - logging.debug("Configuring static routes") - static_routes = CsStaticRoutes("staticroutes", self.config) - static_routes.process() - cmd = "%s -C %s" % (self.CONNTRACKD_BIN, self.CONNTRACKD_CONF) CsHelper.execute("%s -c" % cmd) CsHelper.execute("%s -f" % cmd) @@ -326,6 +322,8 @@ def set_master(self): CsPasswdSvc(interface.get_ip()).start() CsHelper.service("dnsmasq", "restart") + + # From here on the state is master self.cl.set_master_state(True) self.cl.save() self.release_lock() @@ -334,6 +332,11 @@ def set_master(self): CsHelper.reconfigure_interfaces(self.cl, interfaces) logging.info("Router switched to master mode") + # Apply static routes (depends on master state) + logging.debug("Configuring static routes") + static_routes = CsStaticRoutes("staticroutes", self.config) + static_routes.process() + def _collect_ignore_ips(self): """ This returns a list of ip objects that should be ignored