File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -128,9 +128,17 @@ def setUp(self):
128
128
raise SkipTest ("Auth with sharding requires MongoDB >= 2.0.0" )
129
129
if not server_started_with_auth (client ):
130
130
raise SkipTest ('Authentication is not enabled on server' )
131
- self .set_name = client .admin .command ('ismaster' ).get ('setName' )
131
+ response = client .admin .command ('ismaster' )
132
+ self .set_name = str (response .get ('setName' , '' ))
132
133
client .pymongo_test .add_user ('user' , 'pass' )
133
134
client .admin .add_user ('admin' , 'pass' )
135
+ if self .set_name :
136
+ # GLE requires authentication.
137
+ client .admin .authenticate ('admin' , 'pass' )
138
+ # Make sure the admin user is replicated after calling add_user
139
+ # above. This avoids a race in the MRSC tests below. Adding a
140
+ # user is just an insert into system.users.
141
+ client .admin .command ('getLastError' , w = len (response ['hosts' ]))
134
142
self .client = client
135
143
136
144
def tearDown (self ):
You can’t perform that action at this time.
0 commit comments