Commit 1ab87fb5 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[2911] refactoring: use create_zone() instead of the old datasrc API.

parent f714c4ca
......@@ -242,6 +242,10 @@ class MockDataSourceClient():
self.committed_diffs.append(self.diffs)
self.diffs = []
def create_zone(self, zone_name):
# pretend it just succeeds
pass
class MockXfrin(Xfrin):
# This is a class attribute of a callable object that specifies a non
# default behavior triggered in _cc_check_command(). Specific test methods
......
......@@ -656,9 +656,9 @@ class XfrinConnection(asyncore.dispatcher):
if result != DataSourceClient.SUCCESS:
# The data source doesn't know the zone. For now, we provide
# backward compatibility and creates a new one ourselves.
isc.datasrc.sqlite3_ds.load(self._db_file,
self._zone_name.to_text(),
lambda : [])
# For longer term, we should probably separate this level of zone
# management outside of xfrin.
self._datasrc_client.create_zone(self._zone_name)
logger.warn(XFRIN_ZONE_CREATED, self.zone_str())
# try again
result, finder = self._datasrc_client.find_zone(self._zone_name)
......
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