def sshclient(self):
if self._sshclient is None:
host = urlparse.urlparse(self.url).netloc
clnt = paramiko.SSHClient()
clnt.set_missing_host_key_policy(paramiko.WarningPolicy())
clnt.connect(
host, username="ubuntu",
key_filename=self.opts['ssh_private_key_path'])
self._sshclient = clnt
return self._sshclient
评论列表
文章目录