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
评论列表
文章目录