From d29957e0a2f0ff80d4c9eac1605002176bd9b67e Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Tue, 22 Mar 2022 09:47:29 +0000 Subject: [PATCH] Drop old Gnocchi support The distutils version code is deprecated and we also don't support older version of Gnocchi. --- pifpaf/drivers/gnocchi.py | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/pifpaf/drivers/gnocchi.py b/pifpaf/drivers/gnocchi.py index fc45619..1b1da4a 100644 --- a/pifpaf/drivers/gnocchi.py +++ b/pifpaf/drivers/gnocchi.py @@ -16,7 +16,6 @@ import urllib.parse import uuid from distutils import spawn -from distutils import version import click @@ -193,32 +192,7 @@ def _setUp(self): wait_for_line=("(Resource .* already exists" "|Created resource )")) - _, v = self._exec(["gnocchi-api", "--", "--version"], stdout=True) - v = version.LooseVersion(os.fsdecode(v).strip()) - if v < version.LooseVersion("4.1.0"): - LOG.debug("gnocchi version: %s, running uwsgi manually for api", v) - args = [ - "uwsgi", - "--http", "localhost:%d" % self.port, - "--wsgi-file", spawn.find_executable("gnocchi-api"), - "--master", - "--die-on-term", - "--lazy-apps", - "--processes", "4", - "--no-orphans", - "--enable-threads", - "--chdir", self.tempdir, - "--add-header", "Connection: close", - "--pyargv", "--config-file=%s" % conffile, - ] - - virtual_env = os.getenv("VIRTUAL_ENV") - if virtual_env is not None: - args.extend(["-H", virtual_env]) - else: - LOG.debug("gnocchi version: %s, running gnocchi-api", v) - args = ["gnocchi-api", "--config-file=%s" % conffile] - + args = ["gnocchi-api", "--config-file=%s" % conffile] c, _ = self._exec(args, wait_for_line=r"WSGI app 0 \(mountpoint=''\) ready") self.addCleanup(self._kill, c)