Fix replication module failing on timeout

This commit is contained in:
Sergei Antipov 2018-02-22 22:29:39 +07:00
parent 188cbaae59
commit 0e7dbda68d
1 changed files with 5 additions and 1 deletions

View File

@ -301,7 +301,7 @@ def load_mongocnf():
return creds return creds
def wait_for_ok_and_master(module, client, timeout = 60): def wait_for_ok_and_master(module, client, timeout = 120):
while True: while True:
status = client.admin.command('replSetGetStatus', check=False) status = client.admin.command('replSetGetStatus', check=False)
if status['ok'] == 1 and status['myState'] == 1: if status['ok'] == 1 and status['myState'] == 1:
@ -397,6 +397,10 @@ def main():
connection_params = { connection_params = {
"host": login_host, "host": login_host,
"port": int(login_port), "port": int(login_port),
"username": login_user,
"password": login_password,
"authsource": login_database,
"serverselectiontimeoutms": 110000,
} }
if ssl: if ssl: