-
Notifications
You must be signed in to change notification settings - Fork 61
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
Conversation
The pulp.stage.devshift.net currently gives me 500 error when trying to upload an artifact, so I couldn't properly test this yet. |
self.config["api_root"], | ||
domain, | ||
endpoint, | ||
])) |
There was a problem hiding this comment.
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()
?
There was a problem hiding this comment.
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'
There was a problem hiding this comment.
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 += "/" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
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.