Skip to content

Commit 58653af

Browse files
authored
Merge pull request #793 from gerrod3/370-co-none
Ensure compatibility with CONTENT_ORIGIN=None
2 parents bca868c + 18c21ea commit 58653af

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

.github/workflows/scripts/install.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ if [ "$TEST" = "azure" ]; then
110110
- ./azurite:/etc/pulp\
111111
command: "azurite-blob --blobHost 0.0.0.0"' vars/main.yaml
112112
sed -i -e '$a azure_test: true\
113-
pulp_scenario_settings: {"domain_enabled": true}\
113+
pulp_scenario_settings: {"content_origin": null, "domain_enabled": true}\
114114
pulp_scenario_env: {}\
115115
' vars/main.yaml
116116
fi

pulp_python/app/pypi/views.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151

5252
log = logging.getLogger(__name__)
5353

54-
BASE_CONTENT_URL = urljoin(settings.CONTENT_ORIGIN, settings.CONTENT_PATH_PREFIX)
54+
ORIGIN_HOST = settings.CONTENT_ORIGIN if settings.CONTENT_ORIGIN else settings.PYPI_API_HOSTNAME
55+
BASE_CONTENT_URL = urljoin(ORIGIN_HOST, settings.CONTENT_PATH_PREFIX)
5556

5657

5758
class PyPIMixin:

pulp_python/app/utils.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,8 @@ def find_artifact():
315315

316316
content_artifact = content.contentartifact_set.first()
317317
artifact = find_artifact()
318-
origin = settings.CONTENT_ORIGIN.strip("/")
318+
origin = settings.CONTENT_ORIGIN or settings.PYPI_API_HOSTNAME or ""
319+
origin = origin.strip("/")
319320
prefix = settings.CONTENT_PATH_PREFIX.strip("/")
320321
base_path = base_path.strip("/")
321322
components = [origin, prefix, base_path, content.filename]

template_config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ pulp_settings:
4747
pypi_api_hostname: https://pulp:443
4848
pulp_settings_azure:
4949
domain_enabled: true
50+
content_origin: null
5051
pulp_settings_gcp: null
5152
pulp_settings_s3:
5253
domain_enabled: true

0 commit comments

Comments
 (0)