Fixes unicode problems in p35
In py35 the unicode function was removed so I adopted the handling seen in https://github.com/openstack/glance/blob/master/glance/common/exception.py#L57-L61 Change-Id: I2d234b5447ad030ac3996834d89857f28a3537c7
This commit is contained in:
parent
f00eccfafb
commit
c41a2fc427
|
@ -12,6 +12,8 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import six
|
||||
|
||||
from oslo_utils import excutils
|
||||
|
||||
|
||||
|
@ -31,8 +33,7 @@ class AmphoraDriverError(Exception):
|
|||
super(AmphoraDriverError, self).__init__(self.message)
|
||||
|
||||
def __unicode__(self):
|
||||
|
||||
return unicode(self.msg)
|
||||
return six.text_type(self.msg)
|
||||
|
||||
@staticmethod
|
||||
def use_fatal_exceptions():
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
Octavia base exception handling.
|
||||
"""
|
||||
|
||||
import six
|
||||
|
||||
from oslo_utils import excutils
|
||||
from webob import exc
|
||||
|
||||
|
@ -46,7 +48,7 @@ class OctaviaException(Exception):
|
|||
super(OctaviaException, self).__init__(self.message)
|
||||
|
||||
def __unicode__(self):
|
||||
return unicode(self.msg)
|
||||
return six.text_type(self.msg)
|
||||
|
||||
@staticmethod
|
||||
def use_fatal_exceptions():
|
||||
|
|
Loading…
Reference in New Issue