Commit 700f762e authored by Likun Zhang's avatar Likun Zhang
Browse files

Use function get_full_config() provided by isc::config to get all the default...

Use function get_full_config() provided by isc::config to get all the default config setting from xfrout.spec file.

git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1637 e5f2f494-b856-4b98-b285-d166d9295462
parent d71c306a
......@@ -316,14 +316,13 @@ def listen_on_xfr_query(unix_socket_server):
class XfroutServer:
def __init__(self):
self._init_config_data()
self._unix_socket_server = None
self._cc = isc.config.ModuleCCSession(SPECFILE_LOCATION, self.config_handler, self.command_handler)
self._cc.start()
self._lock = threading.Lock()
self._shutdown_event = threading.Event()
self._listen_sock_file = '/tmp/auth_xfrout_conn' # TODO, should this be configurable in cfgmgr
self._shutdown_event = threading.Event()
self._cc = isc.config.ModuleCCSession(SPECFILE_LOCATION, self.config_handler, self.command_handler)
self._config_data = self._cc.get_full_config()
self._start_xfr_query_listener()
self._cc.start()
def _start_xfr_query_listener(self):
'''Start a new thread to accept xfr query. '''
......@@ -338,14 +337,8 @@ class XfroutServer:
listener.start()
def _init_config_data(self):
'''Init the config item here. In case there is some error in config data got from cfgmgr.'''
self._config_data = {'transfers_out': 10, 'db_file':'/tmp/zone.sqlite3'}
def config_handler(self, new_config):
'''Update config data. TODO. Do error check'''
answer = create_answer(0)
for key in new_config:
if key not in self._config_data:
......@@ -353,8 +346,7 @@ class XfroutServer:
continue
self._config_data[key] = new_config[key]
if self._unix_socket_server:
self._unix_socket_server.update_config_data(new_config)
self._unix_socket_server.update_config_data(self._config_data)
return answer
......
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