Merge "Fix discover command failed to discover keystone in ssl"
This commit is contained in:
@@ -75,15 +75,17 @@ class Client(httpclient.HTTPClient):
|
|||||||
|
|
||||||
def _local_keystone_exists(self):
|
def _local_keystone_exists(self):
|
||||||
"""Checks if Keystone is available on default local port 35357."""
|
"""Checks if Keystone is available on default local port 35357."""
|
||||||
return self._check_keystone_versions("http://localhost:35357")
|
results = self._check_keystone_versions("http://localhost:35357")
|
||||||
|
if results is None:
|
||||||
|
results = self._check_keystone_versions("https://localhost:35357")
|
||||||
|
return results
|
||||||
|
|
||||||
def _check_keystone_versions(self, url):
|
def _check_keystone_versions(self, url):
|
||||||
"""Calls Keystone URL and detects the available API versions."""
|
"""Calls Keystone URL and detects the available API versions."""
|
||||||
try:
|
try:
|
||||||
client = httpclient.HTTPClient()
|
resp, body = self.request(url, "GET",
|
||||||
resp, body = client.request(url, "GET",
|
headers={'Accept':
|
||||||
headers={'Accept':
|
'application/json'})
|
||||||
'application/json'})
|
|
||||||
# Multiple Choices status code is returned by the root
|
# Multiple Choices status code is returned by the root
|
||||||
# identity endpoint, with references to one or more
|
# identity endpoint, with references to one or more
|
||||||
# Identity API versions -- v3 spec
|
# Identity API versions -- v3 spec
|
||||||
@@ -143,12 +145,11 @@ class Client(httpclient.HTTPClient):
|
|||||||
def _check_keystone_extensions(self, url):
|
def _check_keystone_extensions(self, url):
|
||||||
"""Calls Keystone URL and detects the available extensions."""
|
"""Calls Keystone URL and detects the available extensions."""
|
||||||
try:
|
try:
|
||||||
client = httpclient.HTTPClient()
|
|
||||||
if not url.endswith("/"):
|
if not url.endswith("/"):
|
||||||
url += '/'
|
url += '/'
|
||||||
resp, body = client.request("%sextensions" % url, "GET",
|
resp, body = self.request("%sextensions" % url, "GET",
|
||||||
headers={'Accept':
|
headers={'Accept':
|
||||||
'application/json'})
|
'application/json'})
|
||||||
if resp.status_code in (200, 204): # some cases we get No Content
|
if resp.status_code in (200, 204): # some cases we get No Content
|
||||||
try:
|
try:
|
||||||
results = {}
|
results = {}
|
||||||
|
Reference in New Issue
Block a user