Commit 6fbf1972 authored by Jeremy C. Reed's avatar Jeremy C. Reed
Browse files

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
parent 91a5a091
......@@ -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.
......@@ -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)
......
......@@ -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:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment