Skip to content

Commit

Permalink
Fixed authentication bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbw committed Mar 7, 2013
1 parent 06746d8 commit 4acf840
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions MongoWrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,11 @@ def __init__(self, dbName, collectionName, hostname='localhost', port=27017, use
self.port = port

self.connection = pymongo.Connection(hostname, port)
self.db = self.connection[self.dbName]
if (username != ""):
self.db.authenticate(username, password)
admin_db = self.connection["admin"]
admin_db = admin_db.authenticate(username, password)

self.db = self.connection[self.dbName]
self.fs = gridfs.GridFS(self.db)

self.collection = self.db[collectionName]
Expand Down

0 comments on commit 4acf840

Please sign in to comment.