def _checkConnectionAttempts(self, conn_attempts, msg):
    conn_attempts += 1
    if (conn_attempts == self._max_conn_retries):
        self.log.error('Unable to connect to SG (attempt %s of %s): %s', conn_attempts, self._max_conn_retries, msg)
        conn_attempts = 0
        time.sleep(self._conn_retry_sleep)
    else:
        self.log.warning('Unable to connect to SG (attempt %s of %s): %s', conn_attempts, self._max_conn_retries, msg)
    return conn_attempts
def _checkConnectionAttempts(self, conn_attempts, msg):
    conn_attempts += 1
    if (conn_attempts == self._max_conn_retries):
        self.log.error('Unable to connect to SG (attempt %s of %s): %s', conn_attempts, self._max_conn_retries, msg)
        conn_attempts = 0
        time.sleep(self._conn_retry_sleep)
    else:
        self.log.warning('Unable to connect to SG (attempt %s of %s): %s', conn_attempts, self._max_conn_retries, msg)
    return conn_attempts