[svn] commit: r1637 - /trunk/src/bin/xfrout/xfrout.py.in
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Mar 24 04:00:19 UTC 2010
Author: zhanglikun
Date: Wed Mar 24 04:00:19 2010
New Revision: 1637
Log:
Use function get_full_config() provided by isc::config to get all the default config setting from xfrout.spec file.
Modified:
trunk/src/bin/xfrout/xfrout.py.in
Modified: trunk/src/bin/xfrout/xfrout.py.in
==============================================================================
--- trunk/src/bin/xfrout/xfrout.py.in (original)
+++ trunk/src/bin/xfrout/xfrout.py.in Wed Mar 24 04:00:19 2010
@@ -316,14 +316,13 @@
class XfroutServer:
def __init__(self):
- self._init_config_data()
- self._unix_socket_server = None
+ 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()
- 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._start_xfr_query_listener()
+
def _start_xfr_query_listener(self):
'''Start a new thread to accept xfr query. '''
@@ -338,14 +337,8 @@
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 @@
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
More information about the bind10-changes
mailing list