Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

First set state to master, then apply static routes #35

Merged
merged 1 commit into from
Jul 11, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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