Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[PR #6308/2094b79f backport][3.72] Fix plugin defaults overriding user settings #6312

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/+default-plugin-settings.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed plugin default settings overriding user settings.
6 changes: 5 additions & 1 deletion pulpcore/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,12 +515,16 @@ def otel_middleware_hook(settings):

# Select enabled plugins and load their settings.
enabled_plugins = settings.get("ENABLED_PLUGINS", None)
plugin_settings = []
for entry_point in entry_points(group="pulpcore.plugin"):
if enabled_plugins and entry_point.name not in enabled_plugins:
continue
if (plugin_app := entry_point.load()) not in settings.INSTALLED_APPS:
settings.load_file(f"{entry_point.module}.app.settings")
plugin_settings.append(f"{entry_point.module}.app.settings")
settings.INSTALLED_APPS += [plugin_app]
# Ensure the plugin defaults are loaded before user configs
settings.PRELOAD_FOR_DYNACONF = plugin_settings
settings.reload()
INSTALLED_APPS = settings.INSTALLED_APPS

# begin compatibility layer for DEFAULT_FILE_STORAGE
Expand Down