Commit 42213653 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[2964] added data_sources for necessary remote config. it's nop for now.

parent 2ed19672
...@@ -135,9 +135,11 @@ class MockCC(MockModuleCCSession, ConfigData): ...@@ -135,9 +135,11 @@ class MockCC(MockModuleCCSession, ConfigData):
module_spec = isc.config.module_spec_from_file( module_spec = isc.config.module_spec_from_file(
xfrin.SPECFILE_LOCATION) xfrin.SPECFILE_LOCATION)
ConfigData.__init__(self, module_spec) ConfigData.__init__(self, module_spec)
# For inspection
self.added_remote_modules = []
def add_remote_config_by_name(self, name, callback): def add_remote_config_by_name(self, name, callback):
pass self.added_remote_modules.append((name, callback))
def get_remote_config_value(self, module, identifier): def get_remote_config_value(self, module, identifier):
if module == 'tsig_keys' and identifier == 'keys': if module == 'tsig_keys' and identifier == 'keys':
...@@ -2461,6 +2463,13 @@ class TestXfrin(unittest.TestCase): ...@@ -2461,6 +2463,13 @@ class TestXfrin(unittest.TestCase):
sys.stderr.close() sys.stderr.close()
sys.stderr = self.stderr_backup sys.stderr = self.stderr_backup
def test_init(self):
"""Check some initial configuration after construction"""
# data source "module" should have been registrered as a necessary
# remote config
self.assertEqual([('data_sources', self.xfr._datasrc_config_handler)],
self.xfr._module_cc.added_remote_modules)
def _do_parse_zone_name_class(self): def _do_parse_zone_name_class(self):
return self.xfr._parse_zone_name_and_class(self.args) return self.xfr._parse_zone_name_and_class(self.args)
......
...@@ -1462,6 +1462,8 @@ class Xfrin: ...@@ -1462,6 +1462,8 @@ class Xfrin:
self._cc_setup() self._cc_setup()
config_data = self._module_cc.get_full_config() config_data = self._module_cc.get_full_config()
self.config_handler(config_data) self.config_handler(config_data)
self._module_cc.add_remote_config_by_name('data_sources',
self._datasrc_config_handler)
init_keyring(self._module_cc) init_keyring(self._module_cc)
def _cc_setup(self): def _cc_setup(self):
...@@ -1530,6 +1532,9 @@ class Xfrin: ...@@ -1530,6 +1532,9 @@ class Xfrin:
# Config handler for changes in Auth configuration # Config handler for changes in Auth configuration
self._set_db_file() self._set_db_file()
def _datasrc_config_handler(self, new_config, config_data):
pass
def shutdown(self): def shutdown(self):
''' shutdown the xfrin process. the thread which is doing xfrin should be ''' shutdown the xfrin process. the thread which is doing xfrin should be
terminated. terminated.
......
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