diff --git a/octavia/amphorae/driver_exceptions/exceptions.py b/octavia/amphorae/driver_exceptions/exceptions.py index 4348ead2ea..2c54234f27 100644 --- a/octavia/amphorae/driver_exceptions/exceptions.py +++ b/octavia/amphorae/driver_exceptions/exceptions.py @@ -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(): diff --git a/octavia/common/exceptions.py b/octavia/common/exceptions.py index 24b58d71c0..dd46c2b6c2 100644 --- a/octavia/common/exceptions.py +++ b/octavia/common/exceptions.py @@ -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():