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

Move bucket_bound_hostname code into helper #121

Closed
IlyaFaer opened this issue Apr 29, 2020 · 1 comment
Closed

Move bucket_bound_hostname code into helper #121

IlyaFaer opened this issue Apr 29, 2020 · 1 comment

Comments

@IlyaFaer
Copy link
Member

@IlyaFaer IlyaFaer commented Apr 29, 2020

For now we have three places in which we're using bucket_bound_hostname. The code is almost the same in all three places, so it'll be good to union it in single helper:

if ":" in bucket_bound_hostname:
api_access_endpoint = bucket_bound_hostname
else:
api_access_endpoint = "{scheme}://{bucket_bound_hostname}".format(
scheme=scheme, bucket_bound_hostname=bucket_bound_hostname
)

if ":" in bucket_bound_hostname:
api_access_endpoint = bucket_bound_hostname
else:
api_access_endpoint = "{scheme}://{bucket_bound_hostname}".format(
scheme=scheme, bucket_bound_hostname=bucket_bound_hostname
)

if ":" in bucket_bound_hostname: # URL includes scheme
url = bucket_bound_hostname
else: # scheme is given separately
url = "{scheme}://{host}/".format(
scheme=scheme, host=bucket_bound_hostname
)

@frankyn
Copy link
Member

@frankyn frankyn commented Apr 29, 2020

that sounds good, thanks for catching the improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants