diff --git a/gnocchi/cli/api.py b/gnocchi/cli/api.py index e84290a0a..4ea8784a2 100644 --- a/gnocchi/cli/api.py +++ b/gnocchi/cli/api.py @@ -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 @@ -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.") diff --git a/gnocchi/utils.py b/gnocchi/utils.py index 7cadf84b0..b342451ef 100644 --- a/gnocchi/utils.py +++ b/gnocchi/utils.py @@ -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 @@ -27,6 +26,7 @@ import daiquiri import iso8601 import numpy +from oslo_utils import strutils import pytimeparse from stevedore import driver import tenacity @@ -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):