mongodb backend accept authsource option#4581
Conversation
|
What left to do to get this PR accepted? I've run into this issue at work and we've tested to confirm the fix here solves the issue. It looks like the unit tests for this failed because they weren't updated to be compatible with the new format of the function call. |
|
please add unittests |
|
Is there any workaruond before this PR being merged? It has been 1 year .. |
|
Unfortunately there are only two workaround options I can see until this is patched:
Neither of these solutions is really ideal.... I opened a new PR to address this with the requested unittests here: #5527. The tests themselves pass but the current build is failing. |
|
@duncaneddy Thanks for your reply! I forked celery and created a release myself using your PR, then replaced celery with This is how I confg celery connection string: from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv())
# MONGODB CONFIGURATIONS
base_url = None
if not os.environ.get('mongo.user') or not os.environ.get('mongo.password'):
base_url = 'mongodb://' + os.environ.get('mongo.host') + ':' + os.environ.get('mongo.port')
else:
base_url = "mongodb://" + os.environ.get('mongo.user') + ':' + os.environ.get('mongo.password') + '@' + \
os.environ.get('mongo.host') + ':' + os.environ.get('mongo.port')
broker_url = base_url + '/' + os.environ.get('mongo.database') + '?authSource=' + os.environ.get('mongo.auth_source')
result_backend = base_url
mongodb_backend_settings = {
'database': os.environ.get('mongo.database'),
'taskmeta_collection': os.environ.get('mongo.collection'),
'options': {'authSource': os.environ.get('mongo.auth_source')}
} |
|
This PR has been superseded by #5527. |
Description
mongodb backend accept authSource option, separate authenticate database and default database.
And it Fixes #4454