diff options
author | Zhi Yan Liu <zhiyanl@cn.ibm.com> | 2014-11-26 15:37:19 +0800 |
---|---|---|
committer | Zhi Yan Liu <lzy.dev@gmail.com> | 2014-11-27 13:52:21 +0800 |
commit | 539138788a14e5b094ef01577486313358375cc0 (patch) | |
tree | f57363285e09cb7c11ab31ec41194f7268ab4d63 /glance_store/exceptions.py | |
parent | 221fc84fba35bfb3f766bd7406ace7be59415bbb (diff) | |
download | glance_store-539138788a14e5b094ef01577486313358375cc0.tar.gz |
Correct GlanceStoreException to provide valid message - glance_store
This fix allows glance_store exception provide a proper error message
instead of None message all the time.
This is the main change on glance_store side. The relevant change on
glance side is I0d6aa29bca3809da4c71d278ef17897eae15ee6c .
Note, once this change on glance_store side get merged, we need to land
the change for glance before release new glance_store.
Change-Id: Ic4423405f831088fb51de7cfdf1243e9a0ff32ea
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
Diffstat (limited to 'glance_store/exceptions.py')
-rw-r--r-- | glance_store/exceptions.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/glance_store/exceptions.py b/glance_store/exceptions.py index 29526d5..df3e1ff 100644 --- a/glance_store/exceptions.py +++ b/glance_store/exceptions.py @@ -46,9 +46,8 @@ class GlanceStoreException(Exception): message = '' def __init__(self, **kwargs): - msg = kwargs.pop('message', None) - self.msg = msg or self.message.format(**kwargs) - super(Exception, self).__init__(msg) + self.msg = kwargs.pop('message', None) or self.message % kwargs + super(Exception, self).__init__(self.msg) class MissingCredentialError(GlanceStoreException): @@ -73,7 +72,7 @@ class UnknownScheme(GlanceStoreException): class BadStoreUri(GlanceStoreException): - message = _("The Store URI was malformed: %(uri)") + message = _("The Store URI was malformed: %(uri)s") class Duplicate(GlanceStoreException): |