From 120b770a02584b0ed9f22853fbeb933cd6c65fc4 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Sun, 30 Sep 2018 13:57:10 -0400 Subject: [PATCH] Add stop and message on DHCP server shutdown --- router-daemon/pvcrd/VXNetworkInstance.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/router-daemon/pvcrd/VXNetworkInstance.py b/router-daemon/pvcrd/VXNetworkInstance.py index 05adee1a..7bc57fda 100644 --- a/router-daemon/pvcrd/VXNetworkInstance.py +++ b/router-daemon/pvcrd/VXNetworkInstance.py @@ -89,6 +89,8 @@ class VXNetworkInstance(): self.dhcp_flag = ( data.decode('ascii') == 'True' ) if self.dhcp_flag and self.this_router.network_state == 'primary': self.startDHCPServer() + elif self.this_router.network_state == 'primary': + self.stopDHCPServer() def getvni(self): return self.vni @@ -236,4 +238,12 @@ class VXNetworkInstance(): def stopDHCPServer(self): if self.dhcp_server: + ansiiprint.echo( + 'Stopping DHCP server on interface {} (VNI {})'.format( + self.bridge_nic, + self.vni + ), + '', + 'o' + ) self.dhcp_server.close()