From b4c9a6d62d8910600e5c50fd710a1a7cc36fff4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Weing=C3=A4rtner?= Date: Tue, 28 May 2024 17:44:13 -0300 Subject: [PATCH 1/3] Enable custom uWSGI path --- gnocchi/cli/api.py | 6 +++++- gnocchi/opts.py | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gnocchi/cli/api.py b/gnocchi/cli/api.py index fc82ac8c1..e934362c5 100644 --- a/gnocchi/cli/api.py +++ b/gnocchi/cli/api.py @@ -71,7 +71,9 @@ def api(): "No need to pass `--' in gnocchi-api command line anymore, " "please remove") - uwsgi = spawn.find_executable("uwsgi") + uwsgi = conf.api.uwsgi_path + if not uwsgi: + uwsgi = spawn.find_executable("uwsgi") if not uwsgi: LOG.error("Unable to find `uwsgi'.\n" "Be sure it is installed and in $PATH.") @@ -113,4 +115,6 @@ def api(): if virtual_env is not None: args.extend(["-H", os.getenv("VIRTUAL_ENV", ".")]) + LOG.debug("Starting gnocchi api server with [%s] and arguments [%s]", + uwsgi, args) return os.execl(uwsgi, uwsgi, *args) diff --git a/gnocchi/opts.py b/gnocchi/opts.py index 9b40071ea..3e6ca6122 100644 --- a/gnocchi/opts.py +++ b/gnocchi/opts.py @@ -193,6 +193,9 @@ def list_opts(): default=10, min=0, help='Number of seconds before timeout when attempting ' 'to do some operations.'), + cfg.StrOpt('uwsgi-path', + default=None, + help="Custom UWSGI path to avoid auto discovery of packages.") ) + API_OPTS + gnocchi.rest.http_proxy_to_wsgi.OPTS, ), ("storage", _STORAGE_OPTS), From f428adb83c20e261a3d37057911158d9635feee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Weing=C3=A4rtner?= Date: Wed, 29 May 2024 09:43:20 -0300 Subject: [PATCH 2/3] Update gnocchi/cli/api.py Co-authored-by: gord chung <5091603+chungg@users.noreply.github.com> --- gnocchi/cli/api.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gnocchi/cli/api.py b/gnocchi/cli/api.py index e934362c5..8de26b455 100644 --- a/gnocchi/cli/api.py +++ b/gnocchi/cli/api.py @@ -71,9 +71,7 @@ def api(): "No need to pass `--' in gnocchi-api command line anymore, " "please remove") - uwsgi = conf.api.uwsgi_path - if not uwsgi: - uwsgi = spawn.find_executable("uwsgi") + uwsgi = conf.api.uwsgi_path or spawn.find_executable("uwsgi") if not uwsgi: LOG.error("Unable to find `uwsgi'.\n" "Be sure it is installed and in $PATH.") From b29799a138424b63ff0e26ab51dab0cdc0b7ffcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Weing=C3=A4rtner?= Date: Fri, 31 May 2024 08:53:20 -0300 Subject: [PATCH 3/3] Address tobias review --- gnocchi/opts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnocchi/opts.py b/gnocchi/opts.py index 3e6ca6122..16eb074a6 100644 --- a/gnocchi/opts.py +++ b/gnocchi/opts.py @@ -193,7 +193,7 @@ def list_opts(): default=10, min=0, help='Number of seconds before timeout when attempting ' 'to do some operations.'), - cfg.StrOpt('uwsgi-path', + cfg.StrOpt('uwsgi_path', default=None, help="Custom UWSGI path to avoid auto discovery of packages.") ) + API_OPTS + gnocchi.rest.http_proxy_to_wsgi.OPTS,