KVMController.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:lib9 作者: Jumpscale 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号