Skip to content

Commit

Permalink
Updating v3 CollectionVersion download URL
Browse files Browse the repository at this point in the history
  • Loading branch information
fao89 committed May 15, 2020
1 parent 8e7d519 commit 8b01f6a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES/6510.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Galaxy V3 download_url now uses fully qualified URL
9 changes: 5 additions & 4 deletions pulp_ansible/app/galaxy/v3/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ def get_download_url(self, obj):
"""
Get artifact download URL.
"""
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}"
host = settings.ANSIBLE_CONTENT_HOSTNAME.strip("/")
distro_base_path = self.context["path"]
filename_path = self.context["content_artifact"].relative_path.lstrip("/")
download_url = f"{host}/{distro_base_path}/{filename_path}"
return download_url

0 comments on commit 8b01f6a

Please sign in to comment.