From: Matan Breizman Date: Wed, 11 Jan 2023 10:57:16 +0000 (+0000) Subject: mgr/prometheus: use vendored "packaging" instead X-Git-Tag: v16.2.11~1^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0e4ead7bb8fa21f9e79ae56c07c992efee3492cb;p=ceph.git mgr/prometheus: use vendored "packaging" instead backport of: cf6089200d96fc56b08ee17a4e31f19823370dc8 Signed-off-by: Matan Breizman --- diff --git a/ceph.spec.in b/ceph.spec.in index 1f68736c3209..82fc6b3585e1 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -610,6 +610,7 @@ Requires: python%{python3_pkgversion}-pecan Requires: python%{python3_pkgversion}-pyOpenSSL Requires: python%{python3_pkgversion}-requests Requires: python%{python3_pkgversion}-dateutil +Requires: python%{python3_pkgversion}-setuptools %if 0%{?fedora} || 0%{?rhel} >= 8 Requires: python%{python3_pkgversion}-cherrypy Requires: python%{python3_pkgversion}-pyyaml diff --git a/debian/control b/debian/control index 4d99ee36f030..bf89deb4741e 100644 --- a/debian/control +++ b/debian/control @@ -88,6 +88,7 @@ Build-Depends: automake, tox , python3-coverage , python3-dateutil , + python3-pkg-resources , python3-openssl , python3-prettytable , python3-requests , diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index 55abc27fd70d..1e47e4aa1fe4 100644 --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@ -1,6 +1,6 @@ import cherrypy from collections import defaultdict -from packaging.version import Version +from pkg_resources import packaging # type: ignore import json import math import os @@ -32,6 +32,7 @@ DEFAULT_PORT = 9283 # ipv6 isn't yet configured / supported and CherryPy throws an uncaught # exception. if cherrypy is not None: + Version = packaging.version.Version v = Version(cherrypy.__version__) # the issue was fixed in 3.2.3. it's present in 3.2.2 (current version on # centos:7) and back to at least 3.0.0. diff --git a/src/pybind/mgr/requirements.txt b/src/pybind/mgr/requirements.txt index d2ee6cf63ff8..252357952701 100644 --- a/src/pybind/mgr/requirements.txt +++ b/src/pybind/mgr/requirements.txt @@ -9,3 +9,4 @@ execnet remoto Jinja2 pyfakefs +setuptools