Skip to content

Commit

Permalink
Merge pull request #35 from MissionCriticalCloud/fix/static-routes-on…
Browse files Browse the repository at this point in the history
…-master-state-change

First set state to master, then apply static routes
  • Loading branch information
Boris Schrijver authored Jul 11, 2016
2 parents f5bff62 + b749b1d commit ad8c4df
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 ad8c4df

Please # to comment.