CLOUDSTACK-9287 - Bring up the private gw interface on state change to master

This commit is contained in:
Remi Bergsma 2016-02-14 18:09:03 +01:00
parent 057b54aa3e
commit 6a767732f9
1 changed files with 3 additions and 2 deletions

View File

@ -292,7 +292,7 @@ class CsRedundant(object):
logging.debug("Setting router to master")
dev = ''
ips = [ip for ip in self.address.get_ips() if ip.is_public() and ip.get_device() in PUBLIC_INTERFACE]
ips = [ip for ip in self.address.get_ips() if ip.is_public()]
route = CsRoute()
for ip in ips:
if dev == ip.get_device():
@ -307,7 +307,8 @@ class CsRedundant(object):
try:
gateway = ip.get_gateway()
logging.info("Adding gateway ==> %s to device ==> %s" % (gateway, dev))
route.add_defaultroute(gateway)
if ip.get_device() in PUBLIC_INTERFACE:
route.add_defaultroute(gateway)
except:
logging.error("ERROR getting gateway from device %s" % dev)
else: