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

Bug 1876852: ceph: fix to support TLS enabled rgw-endpoint #148

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,18 @@ def _invalid_endpoint(self, endpoint_str):
"Out of range port number: {}".format(port))
return False

def endpoint_dial(self, endpoint_str):
try:
ep = "http://" + endpoint_str
r = requests.head(ep)
rc = r.status_code
if rc != 200:
raise ExecutionFailureException(
"wrong return code {} on rgw endpoint http header request".format(rc))
except requests.ConnectionError:
raise ExecutionFailureException(
"failed to connect to rgw endpoint {}".format(ep))
def endpoint_dial(self, endpoint_str, timeout=3):
protocols = ["http", "https"]
for prefix in protocols:
try:
ep = "{}://{}".format(prefix, endpoint_str)
r = requests.head(ep, timeout=timeout)
if r.status_code == 200:
return
except:
continue
raise ExecutionFailureException(
"unable to connect to endpoint: {}".format(endpoint_str))

def __init__(self, arg_list=None):
self.out_map = {}
Expand Down