Skip to content

Commit 0e7dbda

Browse files
committed
Fix replication module failing on timeout
1 parent 188cbaa commit 0e7dbda

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

library/mongodb_replication.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ def load_mongocnf():
301301

302302
return creds
303303

304-
def wait_for_ok_and_master(module, client, timeout = 60):
304+
def wait_for_ok_and_master(module, client, timeout = 120):
305305
while True:
306306
status = client.admin.command('replSetGetStatus', check=False)
307307
if status['ok'] == 1 and status['myState'] == 1:
@@ -397,6 +397,10 @@ def main():
397397
connection_params = {
398398
"host": login_host,
399399
"port": int(login_port),
400+
"username": login_user,
401+
"password": login_password,
402+
"authsource": login_database,
403+
"serverselectiontimeoutms": 110000,
400404
}
401405

402406
if ssl:

0 commit comments

Comments
 (0)