Repository navigation
bugfix: call ensure_conf() in generate_key() - #346
Open
StayPirate wants to merge 1 commit into
Open
StayPirate wants to merge 1 commit into
StayPirate wants to merge 1 commit into
Conversation
generate_key() read app.redbeat_conf directly, so it raised AttributeError when nothing else in the process had initialized the config yet, e.g. a web process that only looks up an entry by name as shown in docs/tasks.rst. The other entry points already go through ensure_conf(). Fixes sibson#345
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #345
generate_key()was the only entry point readingapp.redbeat_confdirectly instead of going throughensure_conf(), so if nothing else in the process had touched RedBeat yet (e.g. a web process that only loads or deletes entries by name, like the snippet in docs/tasks.rst) the first call failed with AttributeError.The fix is the one-liner from the issue. I added a test that calls
generate_key()on a fresh app. The existingtest_generate_keydidn't catch it because it creates an entry first, and that already sets up the config.The new test compares against
redbeat_conf.key_prefixinstead of hardcodingredbeat:, because on a fresh test app the prefix comes out asrb-tests:(the one basecase sets) while the old test getsredbeat:. Looks like a celery conf quirk in the test setup, I didn't dig further since it's unrelated.make testandmake lintpass locally.