@staticmethod
def _test_connection(conn):
    try:
        conn.getLibVersion()
        return True
    except libvirt.libvirtError as e:
        if ((e.get_error_code() in (libvirt.VIR_ERR_SYSTEM_ERROR, libvirt.VIR_ERR_INTERNAL_ERROR)) and (e.get_error_domain() in (libvirt.VIR_FROM_REMOTE, libvirt.VIR_FROM_RPC))):
            LOG.debug('Connection to libvirt broke')
            return False
        raise
@staticmethod
def _test_connection(conn):
    try:
        conn.getLibVersion()
        return True
    except libvirt.libvirtError as e:
        if ((e.get_error_code() in (libvirt.VIR_ERR_SYSTEM_ERROR, libvirt.VIR_ERR_INTERNAL_ERROR)) and (e.get_error_domain() in (libvirt.VIR_FROM_REMOTE, libvirt.VIR_FROM_RPC))):
            LOG.debug('Connection to libvirt broke')
            return False
        raise