diff options
Diffstat (limited to 'saharaclient/api')
-rw-r--r-- | saharaclient/api/base.py | 11 | ||||
-rw-r--r-- | saharaclient/api/shell.py | 1 |
2 files changed, 10 insertions, 2 deletions
diff --git a/saharaclient/api/base.py b/saharaclient/api/base.py index 24be257..c2c9c36 100644 --- a/saharaclient/api/base.py +++ b/saharaclient/api/base.py @@ -18,6 +18,8 @@ import logging import six +from saharaclient.openstack.common.gettextutils import _ + LOG = logging.getLogger(__name__) @@ -130,7 +132,14 @@ class ResourceManager(object): return self.resource_class.resource_name + 's' def _raise_api_exception(self, resp): - error_data = get_json(resp) + try: + error_data = get_json(resp) + except Exception: + raise APIException( + error_code=resp.status_code, + error_message=_("Failed to parse response from Sahara. Check " + "if service catalog configured properly.")) + raise APIException(error_code=error_data.get("error_code"), error_name=error_data.get("error_name"), error_message=error_data.get("error_message")) diff --git a/saharaclient/api/shell.py b/saharaclient/api/shell.py index 2728206..2eac129 100644 --- a/saharaclient/api/shell.py +++ b/saharaclient/api/shell.py @@ -561,7 +561,6 @@ def do_job_binary_data_list(cs, args): def do_job_binary_data_create(cs, args): """Store data in the internal DB. - Store data in the internal DB. Use 'swift upload' instead of this command. Use this command only if Swift is not available. """ |