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