Minor change to excep handling for 4.0 (#53484)

pull/55101/head
Rhys Campbell 5 years ago committed by ansibot
parent e1c4ee2514
commit de14cd7ae8

@ -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:

Loading…
Cancel
Save