Commits

Anonymous committed 851c745

Fix to enable slave dbs.

Comments (0)

Files changed (4)

 database = request.environ['urlmap.database']
 collection = request.environ['urlmap.collection']
 
-db = pymongo.Connection(server)[database][collection]
+db = pymongo.Connection(server, slave_okay=True)[database][collection]
 ndocs = db.count()
 document = db.find_one()
 if document is not None:
 server = request.environ['urlmap.server']
 database = request.environ['urlmap.database']
 
-db = pymongo.Connection(server)[database]
+db = pymongo.Connection(server, slave_okay=True)[database]
 collections = sorted(db.collection_names())
 
 
 
 servers = [ 'localhost'
           , 'xmongo1.paix.yougov.net' 
+          , 'xmongo2.paix.yougov.net' 
           , 'xtgdb0.paix.yougov.net'
            ]
 
 
 server = request.environ['urlmap.server']
 
-conn = pymongo.Connection(server)
+conn = pymongo.Connection(server, slave_okay=True)
 databases = sorted(conn.database_names(), key=lambda a: a.lower())