Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop old Gnocchi support #152

Merged
merged 1 commit into from
Jul 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 1 addition & 27 deletions pifpaf/drivers/gnocchi.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import urllib.parse
import uuid
from distutils import spawn
from distutils import version

import click

Expand Down Expand Up @@ -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)
Expand Down