Replace distutils

distutils module was deprecated in 3.10 and was removed in Python
3.12 .

https://docs.python.org/3.11/library/distutils.html

Closes-Bug: #2083518
Change-Id: Id28c0a7aaabcda0f1f9a6a7402b77a09565899f7
This commit is contained in:
Takashi Kajinami 2024-11-23 05:34:43 +09:00
parent 15a10c6ccd
commit ef2a17c78e
2 changed files with 3 additions and 5 deletions

View File

@ -14,8 +14,6 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from distutils import versionpredicate
from oslo_log import log as logging
from oslo_utils import versionutils
@ -84,8 +82,8 @@ class ImagePropertiesFilter(filters.BaseHostFilter):
version_required = image_props.get('img_hv_requested_version')
if not (hypervisor_version and version_required):
return True
img_prop_predicate = versionpredicate.VersionPredicate(
'image_prop (%s)' % version_required)
img_prop_predicate = versionutils.VersionPredicate(
version_required)
hyper_ver_str = versionutils.convert_version_to_str(hyper_version)
return img_prop_predicate.satisfied_by(hyper_ver_str)

View File

@ -38,7 +38,7 @@ oslo.limit>=1.5.0 # Apache-2.0
oslo.reports>=1.18.0 # Apache-2.0
oslo.serialization>=4.2.0 # Apache-2.0
oslo.upgradecheck>=1.3.0
oslo.utils>=7.3.0 # Apache-2.0
oslo.utils>=7.4.0 # Apache-2.0
oslo.db>=10.0.0 # Apache-2.0
oslo.rootwrap>=5.15.0 # Apache-2.0
oslo.messaging>=14.1.0 # Apache-2.0