Skip to content

Commit 0b0fa8a

Browse files
committed
Fix a deprecation warning about distutils
Fix the following warning. DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. Change-Id: I7ad73576060b5fc536f23c921b752ee3f60d2647 Closes-Bug: 1985970 Signed-off-by: Takashi Natsume <[email protected]>
1 parent 627af67 commit 0b0fa8a

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

nova/virt/ironic/driver.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
"""
2121

2222
import base64
23-
from distutils import version
2423
import gzip
2524
import shutil
2625
import tempfile
2726
import time
2827
from urllib import parse as urlparse
2928

29+
import microversion_parse
3030
from openstack import exceptions as sdk_exc
3131
from oslo_log import log as logging
3232
from oslo_serialization import jsonutils
@@ -2067,13 +2067,17 @@ def _can_send_version(self, min_version=None, max_version=None):
20672067
if self.ironicclient.is_api_version_negotiated:
20682068
current_api_version = self.ironicclient.current_api_version
20692069
if (min_version and
2070-
version.StrictVersion(current_api_version) <
2071-
version.StrictVersion(min_version)):
2070+
microversion_parse.parse_version_string(
2071+
current_api_version) <
2072+
microversion_parse.parse_version_string(
2073+
min_version)):
20722074
raise exception.IronicAPIVersionNotAvailable(
20732075
version=min_version)
20742076
if (max_version and
2075-
version.StrictVersion(current_api_version) >
2076-
version.StrictVersion(max_version)):
2077+
microversion_parse.parse_version_string(
2078+
current_api_version) >
2079+
microversion_parse.parse_version_string(
2080+
max_version)):
20772081
raise exception.IronicAPIVersionNotAvailable(
20782082
version=max_version)
20792083

0 commit comments

Comments
 (0)