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

[2911] deprecated use_ixfr

parent 0332ecca
......@@ -2739,12 +2739,6 @@ class TestXfrin(unittest.TestCase):
Name(zone_config['tsig_key']).to_text())
else:
self.assertIsNone(zone_info.tsig_key_name)
if 'use_ixfr' in zone_config and\
zone_config.get('use_ixfr'):
self.assertTrue(zone_info.use_ixfr)
else:
# if not set, should default to False
self.assertFalse(zone_info.use_ixfr)
if ('request_ixfr' in zone_config and
zone_config.get('request_ixfr')):
cfg_val = zone_config.get('request_ixfr')
......@@ -2926,6 +2920,17 @@ class TestXfrin(unittest.TestCase):
self.assertEqual(self.xfr.config_handler(config)['result'][0], 0)
self._check_zones_config(config)
def test_config_handler_use_ixfr(self):
# use_ixfr was deprecated and explicitly rejected for now.
config = { 'zones': [
{ 'name': 'test.example.',
'master_addr': '192.0.2.1',
'master_port': 53,
'use_ixfr': True
}
]}
self.assertEqual(self.xfr.config_handler(config)['result'][0], 1)
def common_ixfr_setup(self, xfr_mode, request_ixfr, tsig_key_str=None):
# This helper method explicitly sets up a zone configuration with
# request_ixfr, and invokes either retransfer or refresh.
......
......@@ -1314,6 +1314,11 @@ class ZoneInfo:
"""Creates a zone_info with the config data element as
specified by the 'zones' list in xfrin.spec. Module_cc is
needed to get the defaults from the specification"""
# Handle deprecated config parameter explicitly for the moment.
if config_data.get('use_ixfr') is not None:
raise XfrinZoneInfoException('use_ixfr was deprecated.' +
'use rquest_ixfr')
self._module_cc = module_cc
self.set_name(config_data.get('name'))
self.set_master_addr(config_data.get('master_addr'))
......@@ -1321,7 +1326,6 @@ class ZoneInfo:
self.set_master_port(config_data.get('master_port'))
self.set_zone_class(config_data.get('class'))
self.set_tsig_key_name(config_data.get('tsig_key'))
self.set_use_ixfr(config_data.get('use_ixfr'))
self.set_request_ixfr(config_data.get('request_ixfr'))
@property
......@@ -1419,15 +1423,6 @@ class ZoneInfo:
else:
return key
def set_use_ixfr(self, use_ixfr):
"""Set use_ixfr. If set to True, it will use
IXFR for incoming transfers. If set to False, it will use AXFR."""
if use_ixfr is None:
self.use_ixfr = \
self._module_cc.get_default_value("zones/use_ixfr")
else:
self.use_ixfr = use_ixfr
def set_request_ixfr(self, request_ixfr):
if request_ixfr is None:
request_ixfr = \
......
......@@ -2,7 +2,6 @@
"Xfrin": {
"zones": [
{
"use_ixfr": true,
"class": "IN",
"name": "example.com.",
"master_addr": "178.18.82.80"
......
......@@ -18,8 +18,7 @@
"zones": [ {
"name": "example",
"master_addr": "::1",
"master_port": 47807,
"use_ixfr": true
"master_port": 47807
} ]
},
"data_sources": {
......
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