Skip to content

Commit

Permalink
First set state to master, then apply static routes
Browse files Browse the repository at this point in the history
Static routes are only appied on the master and when there is none set
it won't process them.
  • Loading branch information
remibergsma authored and Boris Schrijver committed Jul 9, 2016
1 parent f5bff62 commit b749b1d
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
Expand All @@ -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
Expand Down

0 comments on commit b749b1d

Please # to comment.