Launchpad

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/ b434adba615fd13 9f6d3c8bd173e58 70d102ae83/ glance/ async_/ flows/plugins/ image_conversio n.py#L72
(to set self.python)
and
https:/ /opendev. org/openstack/ glance/ src/commit/ b434adba615fd13 9f6d3c8bd173e58 70d102ae83/ glance/ async_/ flows/plugins/ image_conversio n.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.concurrenc y/src/commit/ 95b9334cfab6849 fbe47e2b118e535 5af3675dba/ oslo_concurrenc y/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.

Read the original on bugs.launchpad.net ↗