def open(self):
uri = None
self.authorized = False
j.tools.prefab.local.system.ssh.keygen(name='libvirt')
self.pubkey = j.tools.prefab.local.core.file_read('/root/.ssh/libvirt.pub')
if self._host != 'localhost':
self.authorized = not self.executor.prefab.system.ssh.authorize(self.user, self.pubkey)
uri = 'qemu+ssh://%s/system?no_tty=1&keyfile=/root/.ssh/libvirt&no_verify=1' % self._host
self.connection = libvirt.open(uri)
self.readonly = libvirt.openReadOnly(uri)
评论列表
文章目录