Skip to content

make localdb-tools compliant with pymongo 4+

Matthias Saimpert requested to merge cherry-pick-c5e5d7aa into devel

(cherry picked from commit c5e5d7aa)

Co-authored-by: Matthias Saimpert matthias.saimpert@cern.ch

The requirements listed here: https://gitlab.cern.ch/YARR/YARR/-/blob/devel/localdb/setting/requirements-pip.txt

mention pymongo>=4.8.0 however I found a place in the code where the deprecated authenticate() function was still used (also checked explicitely that it would crash with pymongo 4.9.1).

This part of the code is used by the localdb/bin/localdbtool-retrieve script which is for instance used in the login_mongodb.sh that we use at Saclay to check quickly good connection with localdb. That is how we ran into that issue.

I made minimal changes to the code allowing it to run with pymongo 4.9.1 so that it is consistent with the requirements-pip.txt. I checked explicitely this is now running fine.

Merge request reports