diff options
author | Zuul <zuul@review.opendev.org> | 2020-04-22 16:47:39 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2020-04-22 16:47:39 +0000 |
commit | 4f316beff7923222fff2496d8619902fa7f1ee78 (patch) | |
tree | 009ba325d921ef4237cbda48f90113b620c57392 /heat | |
parent | 08c5b4655f2967e9576986cfb7946fd1dddd5ed6 (diff) | |
parent | 991e9678460f3c5f0b6a4c38b7931f46e4ddf59b (diff) | |
download | heat-4f316beff7923222fff2496d8619902fa7f1ee78.tar.gz |
Merge "Remove six and python 2.7 full support"
Diffstat (limited to 'heat')
-rw-r--r-- | heat/api/aws/exception.py | 3 | ||||
-rw-r--r-- | heat/api/middleware/fault.py | 3 | ||||
-rw-r--r-- | heat/api/openstack/v1/__init__.py | 3 | ||||
-rw-r--r-- | heat/api/openstack/v1/actions.py | 3 | ||||
-rw-r--r-- | heat/api/openstack/v1/events.py | 3 | ||||
-rw-r--r-- | heat/api/openstack/v1/resources.py | 7 | ||||
-rw-r--r-- | heat/api/openstack/v1/software_configs.py | 3 |
7 files changed, 9 insertions, 16 deletions
diff --git a/heat/api/aws/exception.py b/heat/api/aws/exception.py index d92c24478..90366f861 100644 --- a/heat/api/aws/exception.py +++ b/heat/api/aws/exception.py @@ -17,7 +17,6 @@ """Heat API exception subclasses - maps API response errors to AWS Errors.""" from oslo_utils import reflection -import six import webob.exc from heat.common.i18n import _ @@ -322,7 +321,7 @@ def map_remote_error(ex): ex_type = ex_type[:-len('_Remote')] safe = getattr(ex, 'safe', False) - detail = six.text_type(ex) if safe else None + detail = str(ex) if safe else None if ex_type in inval_param_errors: return HeatInvalidParameterValueError(detail=detail) diff --git a/heat/api/middleware/fault.py b/heat/api/middleware/fault.py index a190ff84d..67418a77a 100644 --- a/heat/api/middleware/fault.py +++ b/heat/api/middleware/fault.py @@ -24,7 +24,6 @@ import traceback from oslo_config import cfg from oslo_utils import reflection -import six import webob from heat.common import exception @@ -127,7 +126,7 @@ class FaultWrapper(wsgi.Middleware): if is_remote: ex_type = ex_type[:-len('_Remote')] - full_message = six.text_type(ex) + full_message = str(ex) if '\n' in full_message and is_remote: message, msg_trace = full_message.split('\n', 1) elif traceback_marker in full_message: diff --git a/heat/api/openstack/v1/__init__.py b/heat/api/openstack/v1/__init__.py index 7a782f1f0..7f625c878 100644 --- a/heat/api/openstack/v1/__init__.py +++ b/heat/api/openstack/v1/__init__.py @@ -12,7 +12,6 @@ # under the License. import routes -import six from heat.api.openstack.v1 import actions from heat.api.openstack.v1 import build_info @@ -51,7 +50,7 @@ class API(wsgi.Router): for r in routes: url = path_prefix + r['url'] methods = r['method'] - if isinstance(methods, six.string_types): + if isinstance(methods, str): methods = [methods] methods_str = ','.join(methods) mapper.connect(r['name'], url, controller=controller, diff --git a/heat/api/openstack/v1/actions.py b/heat/api/openstack/v1/actions.py index 756e7ea98..3a99a445e 100644 --- a/heat/api/openstack/v1/actions.py +++ b/heat/api/openstack/v1/actions.py @@ -11,7 +11,6 @@ # License for the specific language governing permissions and limitations # under the License. -import six from webob import exc from heat.api.openstack.v1 import util @@ -57,7 +56,7 @@ class ActionController(object): if len(body) > 1: raise exc.HTTPBadRequest(_("Multiple actions specified")) - ac = next(six.iterkeys(body)) + ac = next(iter(body.keys())) if ac not in self.ACTIONS: raise exc.HTTPBadRequest(_("Invalid action %s specified") % ac) diff --git a/heat/api/openstack/v1/events.py b/heat/api/openstack/v1/events.py index 465d0ab45..68af75bad 100644 --- a/heat/api/openstack/v1/events.py +++ b/heat/api/openstack/v1/events.py @@ -13,7 +13,6 @@ import itertools -import six from webob import exc from heat.api.openstack.v1 import util @@ -133,7 +132,7 @@ class EventController(object): params[key] = param_utils.extract_int( key, params[key], allow_zero=True) except ValueError as e: - raise exc.HTTPBadRequest(six.text_type(e)) + raise exc.HTTPBadRequest(str(e)) if resource_name is None: if not filter_params: diff --git a/heat/api/openstack/v1/resources.py b/heat/api/openstack/v1/resources.py index dc01e5378..b4befc53c 100644 --- a/heat/api/openstack/v1/resources.py +++ b/heat/api/openstack/v1/resources.py @@ -13,7 +13,6 @@ import itertools -import six from webob import exc from heat.api.openstack.v1 import util @@ -89,7 +88,7 @@ class ResourceController(object): try: return extractor(key, req.params[key]) except ValueError as e: - raise exc.HTTPBadRequest(six.text_type(e)) + raise exc.HTTPBadRequest(str(e)) else: return default @@ -111,7 +110,7 @@ class ResourceController(object): rpc_api.PARAM_WITH_DETAIL])) if invalid_keys: raise exc.HTTPBadRequest(_('Invalid filter parameters %s') % - six.text_type(list(invalid_keys))) + str(list(invalid_keys))) nested_depth = self._extract_to_param(req, rpc_api.PARAM_NESTED_DEPTH, @@ -186,7 +185,7 @@ class ResourceController(object): RES_UPDATE_MARK_UNHEALTHY, body[RES_UPDATE_MARK_UNHEALTHY]) except ValueError as e: - raise exc.HTTPBadRequest(six.text_type(e)) + raise exc.HTTPBadRequest(str(e)) data[RES_UPDATE_STATUS_REASON] = body.get(RES_UPDATE_STATUS_REASON, "") self.rpc_client.resource_mark_unhealthy(req.context, diff --git a/heat/api/openstack/v1/software_configs.py b/heat/api/openstack/v1/software_configs.py index 9724f0248..1e8a426ef 100644 --- a/heat/api/openstack/v1/software_configs.py +++ b/heat/api/openstack/v1/software_configs.py @@ -11,7 +11,6 @@ # License for the specific language governing permissions and limitations # under the License. -import six from webob import exc from heat.api.openstack.v1 import util @@ -42,7 +41,7 @@ class SoftwareConfigController(object): try: return param_utils.extract_bool(name, value) except ValueError as e: - raise exc.HTTPBadRequest(six.text_type(e)) + raise exc.HTTPBadRequest(str(e)) def _index(self, req, use_admin_cnxt=False): whitelist = { |