From ef2a17c78e767357db65b251a5d4a6a7905d54f6 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sat, 23 Nov 2024 05:34:43 +0900 Subject: [PATCH] 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 --- nova/scheduler/filters/image_props_filter.py | 6 ++---- requirements.txt | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/nova/scheduler/filters/image_props_filter.py b/nova/scheduler/filters/image_props_filter.py index ab2c219396c0..733ec32a167e 100644 --- a/nova/scheduler/filters/image_props_filter.py +++ b/nova/scheduler/filters/image_props_filter.py @@ -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) diff --git a/requirements.txt b/requirements.txt index 34e14bdb37a7..4c910a2cf9e9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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