Skip to content

Commit

Permalink
Use CONTENT_ORIGIN instead of CONTENT_HOST
Browse files Browse the repository at this point in the history
pulpcore changed the setting name from CONTENT_HOST to CONTENT_ORIGIN.

Required PR: pulp/pulpcore#370
Required PR: pulp/pulp-smash#1227

https://pulp.plan.io/issues/5629
re #5629
  • Loading branch information
bmbouter authored and daviddavis committed Nov 8, 2019
1 parent b32e6b6 commit e8a9176
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 44 deletions.
39 changes: 0 additions & 39 deletions .travis/playbook.yml

This file was deleted.

1 change: 0 additions & 1 deletion .travis/post_before_install.sh

This file was deleted.

1 change: 1 addition & 0 deletions CHANGES/5629.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Switch to using ``CONTENT_ORIGIN`` instead of ``CONTENT_HOST`` due to core changing the name.
2 changes: 1 addition & 1 deletion docs/workflows/distribution.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Create a Distribution for Repository 'foo'

This will distribute the 'latest' RepositoryVersion always which makes it consumable by
``ansible-galaxy`` client. Users create a Distribution which will serve the RepositoryVersion
content at ``$CONTENT_HOST/pulp/content/<distribution.base_path>`` as demonstrated in the
content at ``$CONTENT_ORIGIN/pulp/content/<distribution.base_path>`` as demonstrated in the
:ref:`ansible-galaxy usage documentation<ansible-galaxy-cli>`.

.. literalinclude:: ../_scripts/distribution_repo.sh
Expand Down
4 changes: 2 additions & 2 deletions pulp_ansible/app/galaxy/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def get_source(self, obj):
"""
Get source.
"""
if settings.CONTENT_HOST:
host = settings.CONTENT_HOST
if settings.CONTENT_ORIGIN:
host = settings.CONTENT_ORIGIN
else:
host = self.context["request"].get_host()
host = "{}://{}".format(self.context["request"].scheme, host)
Expand Down
2 changes: 1 addition & 1 deletion pulp_ansible/app/galaxy/v3/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def get_download_url(self, obj):
"""
Get artifact download URL.
"""
host = settings.CONTENT_HOST.strip("/")
host = settings.CONTENT_ORIGIN.strip("/")
prefix = settings.CONTENT_PATH_PREFIX.strip("/")
base_path = self.context["content_artifact"].relative_path.lstrip("/")
return f"{host}/{prefix}/{base_path}"

0 comments on commit e8a9176

Please sign in to comment.