Skip to content

Commit

Permalink
Get rid of distutils
Browse files Browse the repository at this point in the history
The distutils module was removed from Python 3.12 .
  • Loading branch information
kajinamit committed Oct 2, 2024
1 parent abd2359 commit 061632e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions gnocchi/cli/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import copy
from distutils import spawn
import math
import os
import shutil
import sys

import daiquiri
Expand Down Expand Up @@ -72,7 +72,7 @@ def api():
"No need to pass `--' in gnocchi-api command line anymore, "
"please remove")

uwsgi = conf.api.uwsgi_path or spawn.find_executable("uwsgi")
uwsgi = conf.api.uwsgi_path or shutil.which("uwsgi")
if not uwsgi:
LOG.error("Unable to find `uwsgi'.\n"
"Be sure it is installed and in $PATH.")
Expand Down
4 changes: 2 additions & 2 deletions gnocchi/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# License for the specific language governing permissions and limitations
# under the License.
import datetime
import distutils.util
import errno
import functools
import itertools
Expand All @@ -27,6 +26,7 @@
import daiquiri
import iso8601
import numpy
from oslo_utils import strutils
import pytimeparse
from stevedore import driver
import tenacity
Expand Down Expand Up @@ -201,7 +201,7 @@ def ensure_paths(paths):
def strtobool(v):
if isinstance(v, bool):
return v
return bool(distutils.util.strtobool(v))
return bool(strutils.bool_from_string(v))


class StopWatch(object):
Expand Down

0 comments on commit 061632e

Please sign in to comment.