Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
2dd7ee33
Commit
2dd7ee33
authored
Nov 18, 2011
by
JINMEI Tatuya
Browse files
[1372] covered NotImplemented case
parent
5cea4cfb
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/bin/xfrout/tests/xfrout_test.py.in
View file @
2dd7ee33
...
...
@@ -143,6 +143,8 @@ class MockDataSrcClient:
def get_journal_reader(self, zone_name, begin_serial, end_serial):
if zone_name == Name('notauth2.example.com'):
return isc.datasrc.ZoneJournalReader.NO_SUCH_ZONE, None
if zone_name == Name('nojournal.example.com'):
raise isc.datasrc.NotImplemented('journaling not supported')
if begin_serial == IXFR_NG_VERSION:
return isc.datasrc.ZoneJournalReader.NO_SUCH_VERSION, None
return isc.datasrc.ZoneJournalReader.SUCCESS, self
...
...
@@ -710,6 +712,11 @@ class TestXfroutSession(TestXfroutSessionBase):
self.assertNotEqual(None, self.xfrsess._iterator)
self.assertEqual(None, self.xfrsess._jnl_reader)
# The data source doesn't support journaling. Should fallback to AXFR.
self.assertEqual(self.xfrsess._xfrout_setup(
self.getmsg(), Name('nojournal.example.com')), Rcode.NOERROR())
self.assertNotEqual(None, self.xfrsess._iterator)
# Failure cases
self.assertEqual(self.xfrsess._xfrout_setup(
self.getmsg(), Name('notauth.example.com')), Rcode.NOTAUTH())
...
...
src/bin/xfrout/xfrout.py.in
View file @
2dd7ee33
...
...
@@ -381,11 +381,18 @@ class XfroutSession():
rcode, self._soa = self._get_zone_soa(zone_name)
if rcode != Rcode.NOERROR():
return rcode
code, self._jnl_reader = self._datasrc_client.get_journal_reader(
zone_name, get_soa_serial(remote_soa.get_rdata()[0]),
get_soa_serial(self._soa.get_rdata()[0]))
try:
code, self._jnl_reader = self._datasrc_client.get_journal_reader(
zone_name, get_soa_serial(remote_soa.get_rdata()[0]),
get_soa_serial(self._soa.get_rdata()[0]))
except isc.datasrc.NotImplemented as ex:
# The underlying data source doesn't support journaling.
# Fallback to AXFR-style IXFR.
# TBD: log it.
return self.__setup_axfr(zone_name)
if code == ZoneJournalReader.NO_SUCH_VERSION:
# fallback to AXFR-style IXFR
# TBD: log it.
return self.__setup_axfr(zone_name)
if code == ZoneJournalReader.NO_SUCH_ZONE:
# this is quite unexpected as we know zone's SOA exists.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment