[svn] commit: r1944 - in /branches/likun-value-check/src: bin/bindctl/bindcmd.py lib/dns/python_dns.cc

BIND 10 source code commits bind10-changes at lists.isc.org
Thu May 27 09:07:50 UTC 2010


Author: zhanglikun
Date: Thu May 27 09:07:49 2010
New Revision: 1944

Log:
Ignore value/type check for commands belong to fake module 'config'. 

Modified:
    branches/likun-value-check/src/bin/bindctl/bindcmd.py
    branches/likun-value-check/src/lib/dns/python_dns.cc

Modified: branches/likun-value-check/src/bin/bindctl/bindcmd.py
==============================================================================
--- branches/likun-value-check/src/bin/bindctl/bindcmd.py (original)
+++ branches/likun-value-check/src/bin/bindctl/bindcmd.py Thu May 27 09:07:49 2010
@@ -49,7 +49,7 @@
 except ImportError:
     my_readline = sys.stdin.readline
 
-
+CONFIG_MODULE_NAME = 'config'
 CONST_BINDCTL_HELP = """
 usage: <module name> <command name> [param1 = value1 [, param2 = value2]]
 Type Tab character to get the hint of module/command/parameters.
@@ -304,16 +304,18 @@
                 param_nr += 1
         
         # Convert parameter value according parameter spec file.
-        for param_name in cmd.params:
-            param_spec = command_info.get_param_with_name(param_name).param_spec
-            cmd.params[param_name] = isc.config.config_data.convert_type(param_spec, cmd.params[param_name])
+        # Ignore check for commands belongs to module 'config'
+        if cmd.module != CONFIG_MODULE_NAME:
+            for param_name in cmd.params:
+                param_spec = command_info.get_param_with_name(param_name).param_spec
+                cmd.params[param_name] = isc.config.config_data.convert_type(param_spec, cmd.params[param_name])
 
     
     def _handle_cmd(self, cmd):
         '''Handle a command entered by the user'''
         if cmd.command == "help" or ("help" in cmd.params.keys()):
             self._handle_help(cmd)
-        elif cmd.module == "config":
+        elif cmd.module == CONFIG_MODULE_NAME:
             self.apply_config_cmd(cmd)
         else:
             self.apply_cmd(cmd)
@@ -364,7 +366,7 @@
                 else:                       
                     hints = self._get_param_startswith(cmd.module, cmd.command,
                                                        text)
-                    if cmd.module == "config":
+                    if cmd.module == CONFIG_MODULE_NAME:
                         # grm text has been stripped of slashes...
                         my_text = self.location + "/" + cur_line.rpartition(" ")[2]
                         list = self.config_data.get_config_item_list(my_text.rpartition("/")[0], True)

Modified: branches/likun-value-check/src/lib/dns/python_dns.cc
==============================================================================
--- branches/likun-value-check/src/lib/dns/python_dns.cc (original)
+++ branches/likun-value-check/src/lib/dns/python_dns.cc Thu May 27 09:07:49 2010
@@ -300,7 +300,8 @@
        .def("to_wire", (void (Name::*)(MessageRenderer &)const)&Name::toWire)
        .def("to_wire", (void (Name::*)(OutputBuffer&)const)&Name::toWire)
        .def("compare", &Name::compare)
-       .def("split", &Name::split)
+       .def("split", (Name(Name::*)(unsigned int, unsigned int)const)&Name::split)
+       .def("split", (Name(Name::*)(unsigned int)const)&Name::split)
        .def("concatenate", &Name::concatenate)
        .def("downcase", &Name::downcase, return_value_policy<reference_existing_object>())       
        .def("is_wildcard", &Name::isWildcard)




More information about the bind10-changes mailing list