|
@@ -48,6 +48,12 @@ class BIND10Server:
|
|
|
command handlers as specified in ModuleCCSession.
|
|
|
must be exception free; errors should be signaled
|
|
|
by the return value.
|
|
|
+ _setup_module: can be optionally defined for module-specific
|
|
|
+ initialization. This is called after the module CC
|
|
|
+ session has started, and can be used for registering
|
|
|
+ interest on remote modules, etc. If it raises an
|
|
|
+ exception, the server will be immediatelly stopped.
|
|
|
+ Parameter: None, Return: None
|
|
|
|
|
|
"""
|
|
|
# Will be set to True when the server should stop and shut down.
|
|
@@ -160,6 +166,10 @@ class BIND10Server:
|
|
|
"""The default implementation of the module specific command handler"""
|
|
|
return isc.config.create_answer(1, "Unknown command: " + str(cmd))
|
|
|
|
|
|
+ def _setup_module(self):
|
|
|
+ """The default implementation of the module specific initilization"""
|
|
|
+ pass
|
|
|
+
|
|
|
def run(self, module_name):
|
|
|
"""Start the server and let it run until it's told to stop.
|
|
|
|
|
@@ -183,6 +193,7 @@ class BIND10Server:
|
|
|
signal.signal(signal.SIGTERM, shutdown_sighandler)
|
|
|
signal.signal(signal.SIGINT, shutdown_sighandler)
|
|
|
self._setup_ccsession()
|
|
|
+ self._setup_module()
|
|
|
self._run_internal()
|
|
|
logger.info(PYSERVER_COMMON_SERVER_STOPPED, self.__module_name)
|
|
|
return 0
|