Merge "Fixes unicode problems in p35"

This commit is contained in:
Jenkins 2017-04-25 18:05:56 +00:00 committed by Gerrit Code Review
commit e5db06b465
2 changed files with 6 additions and 3 deletions

View File

@ -12,6 +12,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import six
from oslo_utils import excutils from oslo_utils import excutils
@ -31,8 +33,7 @@ class AmphoraDriverError(Exception):
super(AmphoraDriverError, self).__init__(self.message) super(AmphoraDriverError, self).__init__(self.message)
def __unicode__(self): def __unicode__(self):
return six.text_type(self.msg)
return unicode(self.msg)
@staticmethod @staticmethod
def use_fatal_exceptions(): def use_fatal_exceptions():

View File

@ -17,6 +17,8 @@
Octavia base exception handling. Octavia base exception handling.
""" """
import six
from oslo_utils import excutils from oslo_utils import excutils
from webob import exc from webob import exc
@ -46,7 +48,7 @@ class OctaviaException(Exception):
super(OctaviaException, self).__init__(self.message) super(OctaviaException, self).__init__(self.message)
def __unicode__(self): def __unicode__(self):
return unicode(self.msg) return six.text_type(self.msg)
@staticmethod @staticmethod
def use_fatal_exceptions(): def use_fatal_exceptions():