Minor change to excep handling for 4.0 (#53484)

This commit is contained in:
Rhys Campbell 2019-04-10 18:12:30 +02:00 committed by ansibot
parent e1c4ee2514
commit de14cd7ae8

View file

@ -289,7 +289,7 @@ def main():
try:
client['admin'].command('listDatabases', 1.0) # if this throws an error we need to authenticate
except Exception as excep:
if "not authorized on" in str(excep):
if "not authorized on" in str(excep) or "command listDatabases requires authentication" in str(excep):
if login_user is not None and login_password is not None:
client.admin.authenticate(login_user, login_password, source=login_database)
else: