Browse Source

[1259] The apply method

Michal 'vorner' Vaner 13 years ago
parent
commit
eef5b0eb5d
1 changed files with 12 additions and 1 deletions
  1. 12 1
      src/lib/python/isc/xfrin/diff.py

+ 12 - 1
src/lib/python/isc/xfrin/diff.py

@@ -117,7 +117,18 @@ class Diff:
         It also can raise isc.datasrc.Error. If that happens, you should stop
         using this object and abort the modification.
         """
-        pass
+        # First, compact the data
+        self.compact()
+        # Then pass the data inside the data source
+        for (operation, rrset) in self.__buffer:
+            if operation == 'add':
+                self.__updater.add_rrset(rrset)
+            elif operation == 'remove':
+                self.__updater.remove_rrset(rrset)
+            else:
+                raise ValueError('Unknown operation ' + operation)
+        # As everything is already in, drop the buffer
+        self.__buffer = []
 
     def commit(self):
         """