Handle new gateways better
This commit is contained in:
parent
b0084f6a18
commit
0b5a492859
|
@ -79,9 +79,10 @@ class VXNetworkInstance():
|
||||||
@zk_conn.DataWatch('/networks/{}/ip_gateway'.format(self.vni))
|
@zk_conn.DataWatch('/networks/{}/ip_gateway'.format(self.vni))
|
||||||
def watch_network_gateway(data, stat, event=''):
|
def watch_network_gateway(data, stat, event=''):
|
||||||
if data and self.ip_gateway != data.decode('ascii'):
|
if data and self.ip_gateway != data.decode('ascii'):
|
||||||
|
orig_gateway = self.ip_gateway
|
||||||
self.ip_gateway = data.decode('ascii')
|
self.ip_gateway = data.decode('ascii')
|
||||||
if self.this_router.network_state == 'primary':
|
if self.this_router.network_state == 'primary':
|
||||||
if self.ip_gateway:
|
if orig_gateway:
|
||||||
self.removeGatewayAddress()
|
self.removeGatewayAddress()
|
||||||
self.createGatewayAddress()
|
self.createGatewayAddress()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue