]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1715] Implement the missing unset method
authorMichal 'vorner' Vaner <michal.vaner@nic.cz>
Tue, 27 Mar 2012 11:36:49 +0000 (13:36 +0200)
committerMichal 'vorner' Vaner <michal.vaner@nic.cz>
Tue, 27 Mar 2012 11:52:51 +0000 (13:52 +0200)
The underlying implementation is already there, it's just somebody
forgot to wrap it in this another layer of indirection class.

src/lib/python/isc/config/config_data.py

index e7e810b1f2481162be1bbaa1610cb9665a55f6fc..48d7c1f279db4daee7f2f9fb69a82792d2be1850 100644 (file)
@@ -672,6 +672,16 @@ class MultiConfigData:
                 self._append_value_item(result, spec_part, identifier, all, True)
         return result
 
+    def unset(self, identifier):
+        """
+        Reset the value to default.
+        """
+        spec_part = self.find_spec_part(identifier)
+        if spec_part is not None:
+            isc.cc.data.unset(self._local_changes, identifier)
+        else:
+            raise isc.cc.data.DataNotFoundError(identifier + "not found")
+
     def set_value(self, identifier, value):
         """Set the local value at the given identifier to value. If
            there is a specification for the given identifier, the type