From 8111475eb0f315e0f92a8367a858c49f5fec5ff2 Mon Sep 17 00:00:00 2001 From: Riccardo Pittau Date: Wed, 13 Apr 2022 07:59:06 +0200 Subject: [PATCH] Use Werkzeug modern version Request class from Werkzeug now includes json capability by default. See [1] and [2] for more info. [1] https://github.com/pallets/werkzeug/commit/2cd4fa9484b5d55284a86ac200df603552ba2300 [2] https://github.com/pallets/werkzeug/commit/7b52ecd8f3a67e19df32467a832761f4f0d97c8b Change-Id: I3c74b26ef4aff07c371364203a5b39c658b552a7 --- ironic_python_agent/api/app.py | 3 +-- ironic_python_agent/tests/unit/test_api.py | 3 +-- lower-constraints.txt | 2 +- requirements.txt | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ironic_python_agent/api/app.py b/ironic_python_agent/api/app.py index 93a53bada..47f5dd85b 100644 --- a/ironic_python_agent/api/app.py +++ b/ironic_python_agent/api/app.py @@ -20,7 +20,6 @@ from oslo_service import wsgi import werkzeug from werkzeug import exceptions as http_exc from werkzeug import routing -from werkzeug.wrappers import json as http_json from ironic_python_agent import encoding @@ -30,7 +29,7 @@ _CUSTOM_MEDIA_TYPE = 'application/vnd.openstack.ironic-python-agent.v1+json' _DOCS_URL = 'https://docs.openstack.org/ironic-python-agent' -class Request(werkzeug.Request, http_json.JSONMixin): +class Request(werkzeug.Request): """Custom request class with JSON support.""" diff --git a/ironic_python_agent/tests/unit/test_api.py b/ironic_python_agent/tests/unit/test_api.py index ff71e3231..c9491493c 100644 --- a/ironic_python_agent/tests/unit/test_api.py +++ b/ironic_python_agent/tests/unit/test_api.py @@ -18,7 +18,6 @@ from unittest import mock from oslo_config import cfg from werkzeug import test as http_test from werkzeug import wrappers -from werkzeug.wrappers import json as http_json from ironic_python_agent import agent from ironic_python_agent.api import app @@ -29,7 +28,7 @@ from ironic_python_agent.tests.unit import base as ironic_agent_base PATH_PREFIX = '/v1' -class Response(wrappers.Response, http_json.JSONMixin): +class Response(wrappers.Response): pass diff --git a/lower-constraints.txt b/lower-constraints.txt index 64365d598..5d52a109a 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -1,5 +1,5 @@ Pint==0.5 -Werkzeug==1.0.1 +Werkzeug==2.0.0 bandit==1.1.0 coverage==4.0 cryptography==2.3 diff --git a/requirements.txt b/requirements.txt index 3badcd0e1..d7068f03c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,6 +18,6 @@ requests>=2.14.2 # Apache-2.0 stevedore>=1.20.0 # Apache-2.0 tenacity>=6.2.0 # Apache-2.0 ironic-lib>=5.1.0 # Apache-2.0 -Werkzeug>=1.0.1 # BSD License +Werkzeug>=2.0.0 # BSD License cryptography>=2.3 # BSD/Apache-2.0 tooz>=2.7.2 # Apache-2.0