Browse Source

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

JINMEI Tatuya 12 years ago
parent
commit
1ab87fb582
2 changed files with 7 additions and 3 deletions
  1. 4 0
      src/bin/xfrin/tests/xfrin_test.py
  2. 3 3
      src/bin/xfrin/xfrin.py.in

+ 4 - 0
src/bin/xfrin/tests/xfrin_test.py

@@ -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

+ 3 - 3
src/bin/xfrin/xfrin.py.in

@@ -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)