pycassa/pycassa — pull request #128 by pelotasplus (2012-03-09 10:36:57+00:00)
Title: fix issue with empty server list

right now if server list is empty, like here:

~~~~~~ {python}
def get_cass_address():
return []

keyspace = "foobar"

pool = ConnectionPool(
keyspace,
get_cass_address()
)
~~~~~~

pycassa crashes inside `ConnectionPool::_create_connection()` right after the while loop because `exc` isn't set (it's set inside while loop)

~~~~~~ {python}
while failure_count < 2 * len(self.server_list):
[...]
here we set exc
[...]
raise AllServersUnavailable('An attempt was made to connect to each of the servers ' +
'twice, but none of the attempts succeeded. The last failure was %s: %s' %
(exc.__class__.__name__, exc))
~~~~~~