Browse Source

Add a TODO: entry for saving the default user.

Have the path for bindctl.pem set.


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1429 e5f2f494-b856-4b98-b285-d166d9295462
Jeremy C. Reed 15 years ago
parent
commit
6fbf197240
3 changed files with 6 additions and 3 deletions
  1. 1 0
      src/bin/bindctl/TODO
  2. 4 2
      src/bin/bindctl/bindcmd.py
  3. 1 1
      src/bin/bindctl/bindctl-source.py.in

+ 1 - 0
src/bin/bindctl/TODO

@@ -14,3 +14,4 @@ functions should be updated first.):
         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.

+ 4 - 2
src/bin/bindctl/bindcmd.py

@@ -52,7 +52,7 @@ CONST_COMMAND_NODE = "command"
 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 @@ class BindCmdInterpreter(Cmd):
         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)

+ 1 - 1
src/bin/bindctl/bindctl-source.py.in

@@ -108,7 +108,7 @@ if __name__ == '__main__':
         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: