events_recolector.py 文件源码

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

项目:isard 作者: isard-vdi 项目源码 文件源码
def add_hyp_to_receive_events(self, hyp_id):
        d_hyp_parameters = get_hyp_hostname_user_port_from_id(hyp_id)
        hostname = d_hyp_parameters['hostname']
        user = d_hyp_parameters.get('user', 'root')
        port = d_hyp_parameters.get('port', 22)

        uri = hostname_to_uri(hostname, user=user, port=port)
        conn_ok = False
        try:
            self.hyps_conn[hyp_id] = libvirt.openReadOnly(uri)
            log.debug('####################connection to {} ready in events thread'.format(hyp_id))
            update_uri_hyp(hyp_id, uri)
            conn_ok = True
        except Exception as e:
            log.error('libvirt connection read only in events thread in hypervisor: {}'.format(hyp_id))
            log.error(e)

        if conn_ok is True:
            self.events_ids[hyp_id] = self.register_events(self.hyps_conn[hyp_id])
            self.hyps[hyp_id] = hostname
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号