yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #88406
[Bug 1962581] Re: bad default value for [wsgi] /python_interpreter option
Reviewed: https://review.opendev.org/c/openstack/glance/+/831381
Committed: https://opendev.org/openstack/glance/commit/daa602baa900530fbd0a49ad67e7e1b5e0ae9343
Submitter: "Zuul (22348)"
Branch: master
commit daa602baa900530fbd0a49ad67e7e1b5e0ae9343
Author: Brian Rosmaita <rosmaita.fossdev@xxxxxxxxx>
Date: Tue Mar 1 09:13:09 2022 -0500
Change default value for [wsgi]/python_interpreter
The default value is being set too early. We don't want to use
the value of sys.executable at the time the config is generated,
because that's unlikely to map to an existing interpreter in an
actual deployment.
Change-Id: Ic40f582f83e04c6915a3fcb231d6d95ca071c100
Closes-bug: #1962581
** Changed in: glance
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1962581
Title:
bad default value for [wsgi] /python_interpreter option
Status in Glance:
Fix Released
Bug description:
Noticed when reviewing glance-api.conf in
https://review.opendev.org/c/openstack/glance/+/831368
# Path to the python interpreter to use when spawning external
# processes. By default this is sys.executable, which should be the
# same interpreter running Glance itself. However, in some situations
# (i.e. uwsgi) this may not actually point to a python interpreter
# itself. (string value)
#python_interpreter = /home/ubuntu/glance/.tox/genconfig/bin/python
It's pretty unlikely that that's going to be correct in any actual
deployment.
The option is used by us at:
https://opendev.org/openstack/glance/src/commit/b434adba615fd139f6d3c8bd173e5870d102ae83/glance/async_/flows/plugins/image_conversion.py#L72
(to set self.python)
and
https://opendev.org/openstack/glance/src/commit/b434adba615fd139f6d3c8bd173e5870d102ae83/glance/async_/flows/plugins/image_conversion.py#L95
(to pass self.python as the value of the 'python_exec' argument to putils)
processutils does this with it:
https://opendev.org/openstack/oslo.concurrency/src/commit/95b9334cfab6849fbe47e2b118e5355af3675dba/oslo_concurrency/processutils.py#L332
python_exec = kwargs.pop('python_exec', sys.executable)
This is the point where sys.executable should be evaluated, not when
the option help text is generated.
Thus, the default value glance sets for this option should be None,
which corresponds to putils using sys.executable if the option isn't
set.
To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1962581/+subscriptions
References