Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

backend: add support for pulp domains #3311

Merged
merged 1 commit into from
Jul 4, 2024

Conversation

FrostyX
Copy link
Member

@FrostyX FrostyX commented Jun 24, 2024

The pulp.stage.devshift.net instance has domains enabled while our STG instance has them disabled. As long as it is easy to support both cases, I'd do that.

backend/tests/test_pulp.py Fixed Show fixed Hide fixed
@FrostyX
Copy link
Member Author

FrostyX commented Jun 24, 2024

The pulp.stage.devshift.net currently gives me 500 error when trying to upload an artifact, so I couldn't properly test this yet.

@FrostyX FrostyX marked this pull request as ready for review July 4, 2024 09:04
self.config["api_root"],
domain,
endpoint,
]))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we use os.path for urls already (sub-optimal), don't you want to use os.path.join()?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem with os.path.join is that it does something like this:

>>> os.path.join("/foo/", "/bar/", "/baz/")
'/baz/'

while the "/".join variant produces something more expected

ipdb> os.path.normpath("/".join(["/foo/", "/bar/", "/baz/"]))
'/foo/bar/baz'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, OK


# Normpath removes the trailing slash. If it was there, put it back
if endpoint[-1] == "/":
relative += "/"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

os.path.join() preserves trailing slashes

The pulp.stage.devshift.net instance has domains enabled while our STG
instance has them disabled. As long as it is easy to support both
cases, I'd do that.
Copy link
Member

@praiskup praiskup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@praiskup praiskup merged commit d8013c4 into fedora-copr:main Jul 4, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants