diff --git a/glanceclient/openstack/common/_i18n.py b/glanceclient/openstack/common/_i18n.py index cee8f013..d1339adc 100644 --- a/glanceclient/openstack/common/_i18n.py +++ b/glanceclient/openstack/common/_i18n.py @@ -17,14 +17,14 @@ See http://docs.openstack.org/developer/oslo.i18n/usage.html """ try: - import oslo.i18n + import oslo_i18n # NOTE(dhellmann): This reference to o-s-l-o will be replaced by the # application name when this module is synced into the separate # repository. It is OK to have more than one translation function # using the same domain, since there will still only be one message # catalog. - _translators = oslo.i18n.TranslatorFactory(domain='glanceclient') + _translators = oslo_i18n.TranslatorFactory(domain='glanceclient') # The primary translation function using the well-known name "_" _ = _translators.primary diff --git a/glanceclient/openstack/common/apiclient/base.py b/glanceclient/openstack/common/apiclient/base.py index b208b062..3fc69dd8 100644 --- a/glanceclient/openstack/common/apiclient/base.py +++ b/glanceclient/openstack/common/apiclient/base.py @@ -402,7 +402,7 @@ class CrudManager(BaseManager): 'name': self.resource_class.__name__, 'args': kwargs } - raise exceptions.NotFound(404, msg) + raise exceptions.NotFound(msg) elif num > 1: raise exceptions.NoUniqueMatch else: diff --git a/glanceclient/openstack/common/apiclient/exceptions.py b/glanceclient/openstack/common/apiclient/exceptions.py index be234a9c..c8669f70 100644 --- a/glanceclient/openstack/common/apiclient/exceptions.py +++ b/glanceclient/openstack/common/apiclient/exceptions.py @@ -465,7 +465,7 @@ def from_response(response, method, url): kwargs["details"] = (error.get("details") or six.text_type(body)) elif content_type.startswith("text/"): - kwargs["details"] = response.text + kwargs["details"] = getattr(response, 'text', '') try: cls = _code_map[response.status_code] diff --git a/openstack-common.conf b/openstack-common.conf index e674bc99..b1b30927 100644 --- a/openstack-common.conf +++ b/openstack-common.conf @@ -2,7 +2,6 @@ # The list of modules to copy from openstack-common module=apiclient -module=gettextutils # The base module to hold the copy of openstack.common base=glanceclient