Remove Python 3.8 support
Python 3.8 is no longer part of tested runtimes since 2024.2 . Removing support for Python 3.8 allows us to replace deprecated md5 wrapper from oslo.utils [1] by direct call of hashlib.md5. [1] https://review.opendev.org/c/openstack/oslo.utils/+/930879 Also add python 3.12 to classifiers because now py312 unit test job is voting. Change-Id: I53da305538e27f2ff20a1ecb25960ebb03388011
This commit is contained in:
parent
1ecab6dbc5
commit
91596bef6b
@ -21,6 +21,7 @@ Includes root and intermediate CAs, SSH key_pairs and x509 certificates.
|
|||||||
|
|
||||||
import base64
|
import base64
|
||||||
import binascii
|
import binascii
|
||||||
|
import hashlib
|
||||||
import io
|
import io
|
||||||
import os
|
import os
|
||||||
import typing as ty
|
import typing as ty
|
||||||
@ -36,7 +37,6 @@ from cryptography import x509
|
|||||||
from oslo_concurrency import processutils
|
from oslo_concurrency import processutils
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslo_serialization import base64 as oslo_base64
|
from oslo_serialization import base64 as oslo_base64
|
||||||
from oslo_utils.secretutils import md5
|
|
||||||
import paramiko
|
import paramiko
|
||||||
|
|
||||||
import nova.conf
|
import nova.conf
|
||||||
@ -75,7 +75,7 @@ def generate_fingerprint(public_key: str) -> str:
|
|||||||
serialization.load_ssh_public_key(
|
serialization.load_ssh_public_key(
|
||||||
pub_bytes, backends.default_backend())
|
pub_bytes, backends.default_backend())
|
||||||
pub_data = base64.b64decode(public_key.split(' ')[1])
|
pub_data = base64.b64decode(public_key.split(' ')[1])
|
||||||
raw_fp = md5(pub_data, usedforsecurity=False).hexdigest()
|
raw_fp = hashlib.md5(pub_data, usedforsecurity=False).hexdigest()
|
||||||
return ':'.join(a + b for a, b in zip(raw_fp[::2], raw_fp[1::2]))
|
return ':'.join(a + b for a, b in zip(raw_fp[::2], raw_fp[1::2]))
|
||||||
except Exception:
|
except Exception:
|
||||||
raise exception.InvalidKeypair(
|
raise exception.InvalidKeypair(
|
||||||
|
@ -17,9 +17,10 @@
|
|||||||
Helpers for filesystem related routines.
|
Helpers for filesystem related routines.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import hashlib
|
||||||
|
|
||||||
from oslo_concurrency import processutils
|
from oslo_concurrency import processutils
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslo_utils.secretutils import md5
|
|
||||||
|
|
||||||
import nova.privsep
|
import nova.privsep
|
||||||
|
|
||||||
@ -283,7 +284,7 @@ def _get_hash_str(base_str):
|
|||||||
"""
|
"""
|
||||||
if isinstance(base_str, str):
|
if isinstance(base_str, str):
|
||||||
base_str = base_str.encode('utf-8')
|
base_str = base_str.encode('utf-8')
|
||||||
return md5(base_str, usedforsecurity=False).hexdigest()
|
return hashlib.md5(base_str, usedforsecurity=False).hexdigest()
|
||||||
|
|
||||||
|
|
||||||
def get_file_extension_for_os_type(os_type, default_ephemeral_format,
|
def get_file_extension_for_os_type(os_type, default_ephemeral_format,
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
|
import hashlib
|
||||||
import os
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
import tempfile
|
import tempfile
|
||||||
@ -29,7 +30,6 @@ from oslo_context import context as common_context
|
|||||||
from oslo_context import fixture as context_fixture
|
from oslo_context import fixture as context_fixture
|
||||||
from oslo_utils import encodeutils
|
from oslo_utils import encodeutils
|
||||||
from oslo_utils import fixture as utils_fixture
|
from oslo_utils import fixture as utils_fixture
|
||||||
from oslo_utils.secretutils import md5
|
|
||||||
|
|
||||||
from nova import context
|
from nova import context
|
||||||
from nova import exception
|
from nova import exception
|
||||||
@ -203,7 +203,7 @@ class GenericUtilsTestCase(test.NoDBTestCase):
|
|||||||
def test_get_hash_str(self):
|
def test_get_hash_str(self):
|
||||||
base_str = b"foo"
|
base_str = b"foo"
|
||||||
base_unicode = u"foo"
|
base_unicode = u"foo"
|
||||||
value = md5(base_str, usedforsecurity=False).hexdigest()
|
value = hashlib.md5(base_str, usedforsecurity=False).hexdigest()
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
value, utils.get_hash_str(base_str))
|
value, utils.get_hash_str(base_str))
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
|
@ -44,7 +44,6 @@ import oslo_messaging as messaging
|
|||||||
from oslo_utils import encodeutils
|
from oslo_utils import encodeutils
|
||||||
from oslo_utils import excutils
|
from oslo_utils import excutils
|
||||||
from oslo_utils import importutils
|
from oslo_utils import importutils
|
||||||
from oslo_utils.secretutils import md5
|
|
||||||
from oslo_utils import strutils
|
from oslo_utils import strutils
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
|
|
||||||
@ -791,7 +790,7 @@ def get_hash_str(base_str):
|
|||||||
"""
|
"""
|
||||||
if isinstance(base_str, str):
|
if isinstance(base_str, str):
|
||||||
base_str = base_str.encode('utf-8')
|
base_str = base_str.encode('utf-8')
|
||||||
return md5(base_str, usedforsecurity=False).hexdigest()
|
return hashlib.md5(base_str, usedforsecurity=False).hexdigest()
|
||||||
|
|
||||||
|
|
||||||
def get_sha256_str(base_str):
|
def get_sha256_str(base_str):
|
||||||
|
5
releasenotes/notes/remove-py38-5c619aee267bc1f3.yaml
Normal file
5
releasenotes/notes/remove-py38-5c619aee267bc1f3.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
upgrade:
|
||||||
|
- |
|
||||||
|
Support for Python 3.8 has been removed. Now the minimum python version
|
||||||
|
supported is 3.9 .
|
@ -10,7 +10,7 @@ project_urls =
|
|||||||
Bug Tracker = https://bugs.launchpad.net/nova/
|
Bug Tracker = https://bugs.launchpad.net/nova/
|
||||||
Documentation = https://docs.openstack.org/nova/
|
Documentation = https://docs.openstack.org/nova/
|
||||||
Source Code = https://opendev.org/openstack/nova
|
Source Code = https://opendev.org/openstack/nova
|
||||||
python_requires = >=3.8
|
python_requires = >=3.9
|
||||||
classifiers =
|
classifiers =
|
||||||
Development Status :: 5 - Production/Stable
|
Development Status :: 5 - Production/Stable
|
||||||
Environment :: OpenStack
|
Environment :: OpenStack
|
||||||
@ -20,10 +20,10 @@ classifiers =
|
|||||||
Operating System :: POSIX :: Linux
|
Operating System :: POSIX :: Linux
|
||||||
Programming Language :: Python
|
Programming Language :: Python
|
||||||
Programming Language :: Python :: 3
|
Programming Language :: Python :: 3
|
||||||
Programming Language :: Python :: 3.8
|
|
||||||
Programming Language :: Python :: 3.9
|
Programming Language :: Python :: 3.9
|
||||||
Programming Language :: Python :: 3.10
|
Programming Language :: Python :: 3.10
|
||||||
Programming Language :: Python :: 3.11
|
Programming Language :: Python :: 3.11
|
||||||
|
Programming Language :: Python :: 3.12
|
||||||
Programming Language :: Python :: 3 :: Only
|
Programming Language :: Python :: 3 :: Only
|
||||||
Programming Language :: Python :: Implementation :: CPython
|
Programming Language :: Python :: Implementation :: CPython
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user