Skip to content

Commit 5affdb3

Browse files
committed
update db connect mongo connection test
1 parent 282e916 commit 5affdb3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

st2common/st2common/models/db/__init__.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,9 @@ def _db_connect(
199199
# successfully established.
200200
# See http://api.mongodb.com/python/current/api/pymongo/mongo_client.html for details
201201
try:
202-
# The ismaster command is cheap and does not require auth
203-
connection.admin.command("ismaster")
202+
# The hello command is cheap and does not require auth
203+
# https://docs.mongodb.com/v4.4/reference/command/hello/
204+
connection.admin.command("hello")
204205
except (ConnectionFailure, ServerSelectionTimeoutError) as e:
205206
# NOTE: ServerSelectionTimeoutError can also be thrown if SSLHandShake fails in the server
206207
# Sadly the client doesn't include more information about the error so in such scenarios

0 commit comments

Comments
 (0)