[svn] commit: r1429 - in /trunk/src/bin/bindctl: TODO bindcmd.py bindctl-source.py.in

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Mar 16 00:21:30 UTC 2010


Author: jreed
Date: Tue Mar 16 00:21:30 2010
New Revision: 1429

Log:
Add a TODO: entry for saving the default user.

Have the path for bindctl.pem set.

Modified:
    trunk/src/bin/bindctl/TODO
    trunk/src/bin/bindctl/bindcmd.py
    trunk/src/bin/bindctl/bindctl-source.py.in

Modified: trunk/src/bin/bindctl/TODO
==============================================================================
--- trunk/src/bin/bindctl/TODO (original)
+++ trunk/src/bin/bindctl/TODO Tue Mar 16 00:21:30 2010
@@ -14,3 +14,4 @@
         moduleinfo.py:
             get_param_name_by_position
 5. Understandable error message when cert_file is missing.
+6. Pick location to save default user. Or use the cfgmgr for this.

Modified: trunk/src/bin/bindctl/bindcmd.py
==============================================================================
--- trunk/src/bin/bindctl/bindcmd.py (original)
+++ trunk/src/bin/bindctl/bindcmd.py Tue Mar 16 00:21:30 2010
@@ -52,7 +52,7 @@
 class BindCmdInterpreter(Cmd):
     """simple bindctl example."""    
 
-    def __init__(self, server_port = 'localhost:8080'):
+    def __init__(self, server_port = 'localhost:8080', pem_file = "bindctl.pem"):
         Cmd.__init__(self)
         self.location = ""
         self.prompt_end = '> '
@@ -61,13 +61,15 @@
         self.modules = OrderedDict()
         self.add_module_info(ModuleInfo("help", desc = "Get help for bindctl"))
         self.server_port = server_port
+        self.pem_file = pem_file
         self._connect_to_cmd_ctrld()
         self.session_id = self._get_session_id()
 
     def _connect_to_cmd_ctrld(self):
         '''Connect to cmdctl in SSL context. '''
         try:
-            self.conn = http.client.HTTPSConnection(self.server_port, cert_file='bindctl.pem')
+            self.conn = http.client.HTTPSConnection(self.server_port,
+                          cert_file=self.pem_file)
         except  Exception as e:
             print(e, "can't connect to %s, please make sure cmd-ctrld is running" %
                   self.server_port)

Modified: trunk/src/bin/bindctl/bindctl-source.py.in
==============================================================================
--- trunk/src/bin/bindctl/bindctl-source.py.in (original)
+++ trunk/src/bin/bindctl/bindctl-source.py.in Tue Mar 16 00:21:30 2010
@@ -108,7 +108,7 @@
         set_bindctl_options(parser)
         (options, args) = parser.parse_args()
         server_addr = options.addr + ':' + str(options.port)
-        tool = BindCmdInterpreter(server_addr)
+        tool = BindCmdInterpreter(server_addr, pem_file = "@@SYSCONFDIR@@/bind10/bindctl.pem")
         prepare_config_commands(tool)
         tool.run()
     except Exception as e:




More information about the bind10-changes mailing list