'Setup the connection'

def setup(self):

    global cluster, session
    if (('username' in self.cluster_options) or ('password' in self.cluster_options)):
        raise CQLEngineException("Username    &    Password    are    now    handled    by    using    the    native    driver's    auth_provider")
    if self.lazy_connect:
        return
    self.cluster = Cluster(self.hosts, **self.cluster_options)
    try:
        self.session = self.cluster.connect()
        log.debug(format_log_context('connection    initialized    with    internally    created    session', connection=self.name))
    except NoHostAvailable:
        if self.retry_connect:
            log.warning(format_log_context('connect    failed,    setting    up    for    re-attempt    on    first    use', connection=self.name))
            self.lazy_connect = True
        raise
    if (self.consistency is not None):
        self.session.default_consistency_level = self.consistency
    if ((DEFAULT_CONNECTION in _connections) and (_connections[DEFAULT_CONNECTION] == self)):
        cluster = _connections[DEFAULT_CONNECTION].cluster
        session = _connections[DEFAULT_CONNECTION].session
    self.setup_session()
