def connect(self, kwargs):
try:
# get config
config = self.get_connect_config(kwargs)
typ = config['type']
# check for subtype
if ':' in typ:
typ = config['type'].split(':', 1)[0]
cls = ngage.plugin.get_plugin_class(typ)
drv = cls(config)
self.log.debug("connecting to {host}".format(**config))
drv.open()
return drv
except AuthenticationError:
config['password'] = click.prompt('password', hide_input=True)
if config['password']:
return connect(config)
raise
评论列表
文章目录