diff --git a/gnocchi/cli/api.py b/gnocchi/cli/api.py index fc82ac8c1..8de26b455 100644 --- a/gnocchi/cli/api.py +++ b/gnocchi/cli/api.py @@ -71,7 +71,7 @@ def api(): "No need to pass `--' in gnocchi-api command line anymore, " "please remove") - 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.") @@ -113,4 +113,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..16eb074a6 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),