Remove the auth_source kwarg in connect_to_mongodb, since we're now relying on authsource (no underscore) and the pymongo Database init does not expect and will not tolerate an auth_source kwarg.

This commit is contained in:
Alex Dusenbery
2020-03-02 14:16:32 -05:00
committed by Alex Dusenbery
parent 6433e88ac8
commit 530cabd003

View File

@@ -48,6 +48,11 @@ def connect_to_mongodb(
# If the MongoDB server uses a separate authentication database that should be specified here
auth_source = kwargs.get('authsource', '') or None
# sanitize a kwarg which may be present and is no longer expected
# AED 2020-03-02 TODO: Remove this when 'auth_source' will no longer exist in kwargs
if 'auth_source' in kwargs:
kwargs.pop('auth_source')
# If read_preference is given as a name of a valid ReadPreference.<NAME>
# constant such as "SECONDARY_PREFERRED" or a mongo mode such as
# "secondaryPreferred", convert it. Otherwise pass it through unchanged.