Commit 8b67cc82 authored by Michal Vaner's avatar Michal Vaner
Browse files

Do not try to shutdown twice

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac335@3259 e5f2f494-b856-4b98-b285-d166d9295462
parent 8296f2cd
......@@ -419,6 +419,7 @@ class Zonemgr:
self._lock = threading.Lock()
self._shutdown_event = threading.Event()
self.running = False
def _setup_session(self):
"""Setup two sessions for zonemgr, one(self._module_cc) is used for receiving
......@@ -450,6 +451,7 @@ class Zonemgr:
self._slave_socket.close()
self._master_socket.close()
self._shutdown_event.set()
self.running = False
def config_handler(self, new_config):
"""Update config data."""
......@@ -519,6 +521,7 @@ class Zonemgr:
return answer
def run(self):
self.running = True
while not self._shutdown_event.is_set():
self._module_cc.check_command()
......@@ -558,6 +561,6 @@ if '__main__' == __name__:
except isc.config.ModuleCCSessionError as e:
sys.stderr.write("[b10-zonemgr] exit zonemgr process: %s\n" % str(e))
if zonemgrd:
if zonemgrd and zonemgrd.running:
zonemgrd.shutdown()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment