Browse Source

a bit of checks on get_config answer

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/parkinglot@568 e5f2f494-b856-4b98-b285-d166d9295462
Jelte Jansen 15 years ago
parent
commit
989d0d7180
1 changed files with 7 additions and 2 deletions
  1. 7 2
      src/lib/config/python/isc/config/CCSession.py

+ 7 - 2
src/lib/config/python/isc/config/CCSession.py

@@ -82,6 +82,11 @@ class CCSession:
         """Asks the configuration manager for the current configuration, and call the config handler if set"""
         """Asks the configuration manager for the current configuration, and call the config handler if set"""
         self._session.group_sendmsg({ "command": [ "get_config", { "module_name": self._module_name } ] }, "ConfigManager")
         self._session.group_sendmsg({ "command": [ "get_config", { "module_name": self._module_name } ] }, "ConfigManager")
         answer, env = self._session.group_recvmsg(False)
         answer, env = self._session.group_recvmsg(False)
-        if self._config_handler:
+        if "result" in answer:
-            self._config_handler(answer["result"])
+            if answer["result"][0] == 0 and len(answer["result"]) > 1:
+                new_config = answer["result"][1]
+                if self._data_definition.validate(new_config):
+                    self._config = new_config;
+                    if self._config_handler:
+                        self._config_handler(answer["result"])