Get rid of distutils

... because it was removed in Python 3.12 .

Change-Id: Ib98623ff328c0823c614b6a9d3a6d9c11d356510
This commit is contained in:
Takashi Kajinami 2024-10-02 23:28:50 +09:00
parent b438cffeb5
commit b3cb2cc9b7

View File

@ -15,13 +15,13 @@
"""wsgi transport helpers.""" """wsgi transport helpers."""
from distutils import version
import re import re
from stevedore import driver from stevedore import driver
import uuid import uuid
import falcon import falcon
from oslo_log import log as logging from oslo_log import log as logging
from oslo_utils import versionutils
from zaqar.common import urls from zaqar.common import urls
from zaqar import context from zaqar import context
@ -101,9 +101,8 @@ def extract_project_id(req, resp, params):
u'string. Specify the right header ' u'string. Specify the right header '
u'X-PROJECT-ID and retry.')) u'X-PROJECT-ID and retry.'))
api_version = version.LooseVersion(api_version_string) if not params['project_id'] and versionutils.is_compatible(
if (not params['project_id'] and api_version >= 'v1.1', api_version_string, same_major=False):
version.LooseVersion('v1.1')):
raise falcon.HTTPBadRequest('Project-Id Missing', raise falcon.HTTPBadRequest('Project-Id Missing',
_(u'The header X-PROJECT-ID was missing')) _(u'The header X-PROJECT-ID was missing'))