Fix loading main_config again during discovery of dynamic configurations #450
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.
Related Issue: #445
New Behavior
The main configuration files,
configuration.py
andldap_config.py
, were accidentally loaded twice: The initial load was hard-coded and correct. But during the discovery of the dynamic, user-contributed configuration files (likeextra.py
orwhatever.py
), the main configuration files were discovered as well and loaded again.They have thereby overwritten all settings in files that were loaded before them.
An example, given the file
a_config.py
:The old behavior was:
configuration.py
a_config.py
andconfiguration.py
BANNER_LOGIN
to what is found ina_config.py
.BANNER_LOGIN
to what is found inconfiguration.py
,because it's alphabetically after
a_config.py
and falsely discovered again.The new behavior is – as it should be:
configuration.py
a_config.py
andconfiguration.py
, but ignoreconfiguration.py
, as it's the main config file.BANNER_LOGIN
to what is found ina_config.py
.Thanks to @tobiasge for discovering this bug.
Contrast to Current Behavior
The described bug has now been fixed. During the discovery for dynamic configurations,
when loading each of the discovered configuration files, the main_config file is now excluded.
Discussion: Benefits and Drawbacks
The intended behavior is achieved: All values of the main configuration files can be overwritten with values in arbitrarily named custom configuration files.
Changes to the Wiki
n/a
Proposed Release Note Entry
Double Check
develop
branch.