From 01443a65d714db65782138cef43404a01a052b74 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Wed, 2 Oct 2024 23:39:01 +0900 Subject: [PATCH] Replace distutils distutils was deprecated in Python 3.10 and was removed in Python 3.12 [1]. [1] https://docs.python.org//3.10/library/distutils.html Change-Id: Ibe151db2b3670675535dce8558f8209f5861c9e5 --- zaqarclient/transport/http.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/zaqarclient/transport/http.py b/zaqarclient/transport/http.py index 7d9064a1..247ed576 100644 --- a/zaqarclient/transport/http.py +++ b/zaqarclient/transport/http.py @@ -13,10 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -from distutils import version import json from oslo_utils import importutils +from oslo_utils import versionutils from zaqarclient.common import http from zaqarclient.transport import base @@ -79,8 +79,7 @@ class HttpTransport(base.Transport): # request's headers directly. headers = request.headers.copy() if (request.operation == 'queue_update' and - (version.LooseVersion(request.api.label) >= - version.LooseVersion('v2'))): + versionutils.is_compatible(request.api.label, 'v2')): headers['content-type'] = \ 'application/openstack-messaging-v2.0-json-patch' else: