Skip to content

Commit

Permalink
Add a sentinal value to CONTENT_ORIGIN
Browse files Browse the repository at this point in the history
This helps circumventing issues where plugins rely on the setting, but a
command is bypassing the checks.

fixes #5510

(cherry picked from commit a809c10)
  • Loading branch information
mdellweg committed Jun 24, 2024
1 parent 284f8a0 commit 751c15f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES/5510.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed openapi command where plugins relied on CONTENT_ORIGIN to be set.
2 changes: 1 addition & 1 deletion pulpcore/app/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
@register(deploy=True)
def content_origin_check(app_configs, **kwargs):
messages = []
if not getattr(settings, "CONTENT_ORIGIN", None):
if getattr(settings, "CONTENT_ORIGIN", "UNREACHABLE") == "UNREACHABLE":
messages.append(
CheckError(
"CONTENT_ORIGIN is a required setting but it was not configured. This may be "
Expand Down
2 changes: 2 additions & 0 deletions pulpcore/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@

DRF_ACCESS_POLICY = {"reusable_conditions": ["pulpcore.app.global_access_conditions"]}

# This is a sentinal value for deploy checks, since we don't want to set a default one.
CONTENT_ORIGIN = "UNREACHABLE"
CONTENT_PATH_PREFIX = "/pulp/content/"

API_APP_TTL = 120 # The heartbeat is called from gunicorn notify (defaulting to 45 sec).
Expand Down

0 comments on commit 751c15f

Please sign in to comment.