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
ceph: fix to support TLS enabled rgw-endpoint #6227
Conversation
| for prefix in protocols: | ||
| try: | ||
| ep = "{}://{}".format(prefix, endpoint_str) | ||
| r = requests.head(ep) |
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.
What's the timeout all ready for this? Can we shorten it to a few seconds? Like <5s?
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.
I have added 3 second as per the following doc,
:param timeout: (optional) How many seconds to wait for the server to send data
before giving up, as a float, or a :ref:`(connect timeout, read timeout) <timeouts>` tuple.
:type timeout: float or tuple
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.
Did you test your change?
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.
Yes I have tested my change individually (by providing URLs like golang , youtube websites and other non-existing) on a separate python file. It works within the timeout.
import sys
import requests
class ExecutionFailureException(Exception):
pass
def endpoint_check(endpoint_str, timeout=5):
protocols = ["http", "https"]
for prefix in protocols:
try:
ep = "{}://{}".format(prefix, endpoint_str)
print("EP: {}".format(ep))
r = requests.head(ep, timeout=timeout)
if r.status_code == 200:
return
print("EP Status: {}".format(r.status_code))
except:
continue
raise ExecutionFailureException(
"unable to connect to endpoint: {}".format(endpoint_str))
def main():
endpoint = "vlang.io"
if len(sys.argv) > 1:
endpoint = sys.argv[1]
endpoint_check(endpoint, timeout=3)
if __name__ == "__main__":
main()5f08b24
to
f832e23
Compare
Signed-off-by: Arun Kumar Mohan <amohan@redhat.com>
f832e23
to
3de87cc
Compare
ceph: fix to support TLS enabled rgw-endpoint (bp #6227)
Signed-off-by: Arun Kumar Mohan amohan@redhat.com
Description of your changes:
Enables the 'create-external-cluster-resources.py' script to check a given TLS (https) enabled rgw-endpoint.
Which issue is resolved by this Pull Request:
Resolves #
Checklist:
make codegen) has been run to update object specifications, if necessary.[skip ci]