Skip to content

Commit

Permalink
Set keyspace on conn after (potentially) logging in
Browse files Browse the repository at this point in the history
Authenticators may require that users be logged in prior to
executing set_keyspace() now in order to avoid leaking info
about what keyspaces exist.
  • Loading branch information
thobbs committed Jan 25, 2013
1 parent 7d6a6ee commit fb2c04a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pycassa/connection.py
Expand Up @@ -50,12 +50,12 @@ def __init__(self, keyspace, server, framed_transport=True, timeout=None,
Cassandra.Client.__init__(self, protocol)
self.transport.open()

self.set_keyspace(keyspace)

if credentials is not None:
request = AuthenticationRequest(credentials=credentials)
self.login(request)

self.set_keyspace(keyspace)

def set_keyspace(self, keyspace):
if keyspace != self.keyspace:
Cassandra.Client.set_keyspace(self, keyspace)
Expand Down

0 comments on commit fb2c04a

Please sign in to comment.