← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1962581] [NEW] bad default value for [wsgi] /python_interpreter option

 

Public bug reported:

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.

** Affects: glance
     Importance: Low
     Assignee: Brian Rosmaita (brian-rosmaita)
         Status: Triaged

** Changed in: glance
     Assignee: (unassigned) => Brian Rosmaita (brian-rosmaita)

-- 
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:
  Triaged

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



Follow ups