Merge "Remove six[3]"

This commit is contained in:
Zuul
2020-04-18 09:26:33 +00:00
committed by Gerrit Code Review

View File

@@ -28,7 +28,6 @@ import sys
from keystoneclient import exceptions as keystone_exceptions from keystoneclient import exceptions as keystone_exceptions
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log from oslo_log import log
import six
from watcher._i18n import _ from watcher._i18n import _
@@ -97,19 +96,16 @@ class WatcherException(Exception):
def __str__(self): def __str__(self):
"""Encode to utf-8 then wsme api can consume it as well""" """Encode to utf-8 then wsme api can consume it as well"""
if not six.PY3: return self.args[0]
return six.text_type(self.args[0]).encode('utf-8')
else:
return self.args[0]
def __unicode__(self): def __unicode__(self):
return six.text_type(self.args[0]) return str(self.args[0])
def format_message(self): def format_message(self):
if self.__class__.__name__.endswith('_Remote'): if self.__class__.__name__.endswith('_Remote'):
return self.args[0] return self.args[0]
else: else:
return six.text_type(self) return str(self)
class UnsupportedError(WatcherException): class UnsupportedError(WatcherException):