Merge "Fix "software --os-region-name SystemController show" returning 404"
This commit is contained in:
commit
93f38e5f62
@ -5,6 +5,7 @@
|
||||
#
|
||||
|
||||
from oslo_utils import importutils
|
||||
from urllib.parse import urljoin
|
||||
|
||||
from software_client import exc
|
||||
from software_client.constants import LOCAL_ROOT
|
||||
@ -131,7 +132,7 @@ def get_client(api_version, auth_mode, session=None, service_type=SERVICE_TYPE,
|
||||
if endpoint:
|
||||
api_version_str = 'v' + api_version
|
||||
if api_version_str not in endpoint.split('/'):
|
||||
endpoint = endpoint + '/' + api_version_str
|
||||
endpoint = urljoin(endpoint, api_version_str)
|
||||
|
||||
if session:
|
||||
# this will be a LegacyJsonAdapter
|
||||
|
@ -122,6 +122,10 @@ def _display_info(text):
|
||||
'''display the basic info json object '''
|
||||
try:
|
||||
data = json.loads(text)
|
||||
if "error_message" in data:
|
||||
data = json.loads(data["error_message"])
|
||||
if "faultstring" in data:
|
||||
data = json.loads(data["faultstring"])
|
||||
except Exception:
|
||||
print(f"Invalid response format: {text}")
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user