Permalink
Browse files

Update URI warning in MongoReplicaSetClient.

  • Loading branch information...
1 parent 76b8b40 commit c5c7bdf5bf63730c6a787bf53f5d7cfb80925766 @behackett behackett committed Nov 27, 2012
Showing with 6 additions and 4 deletions.
  1. +3 −2 pymongo/mongo_client.py
  2. +3 −2 pymongo/mongo_replica_set_client.py
View
@@ -274,8 +274,9 @@ def __init__(self, host=None, port=None, max_pool_size=10,
raise ConnectionFailure(str(e))
if db and username is None:
- warnings.warn("database name in URI is being ignored. if you wish to authenticate to %s, "
- "you must provide a username and password" % (db,))
+ warnings.warn("database name in URI is being ignored. If you wish "
+ "to authenticate to %s, you must provide a username "
+ "and password." % (db,))
if username:
db = db or "admin"
if not self[db].authenticate(username, password):
@@ -433,8 +433,9 @@ def __init__(self, hosts_or_uri=None, max_pool_size=10,
raise ConnectionFailure(str(e))
if db_name and username is None:
- warnings.warn("must provide a username and password "
- "to authenticate to %s" % (db_name,))
+ warnings.warn("database name in URI is being ignored. If you wish "
+ "to authenticate to %s, you must provide a username "
+ "and password." % (db_name,))
if username:
db_name = db_name or 'admin'
if not self[db_name].authenticate(username, password):

0 comments on commit c5c7bdf

Please sign in to comment.