Remove workaround for python_exec cannot be None

oslo.config 4.5.1 contains change I2e1f187feaf4, which makes
the workaround introduced by change Ic40f582f83e0 unnecessary.

Change-Id: Ib7fc2f2082981b1765e901ca5b277fce08221ba8
Related-bug: #1962581
Related-bug: #1962603
This commit is contained in:
Brian Rosmaita 2022-05-09 11:39:11 -04:00
parent 2e94e3dc71
commit 6af8b6e51c
3 changed files with 5 additions and 14 deletions

View File

@ -15,7 +15,6 @@
import json
import os
import sys
from oslo_concurrency import processutils as putils
from oslo_config import cfg
@ -70,7 +69,7 @@ class _ConvertImage(task.Task):
self.action_wrapper = action_wrapper
self.image_id = action_wrapper.image_id
self.dest_path = ""
self.python = CONF.wsgi.python_interpreter or sys.executable
self.python = CONF.wsgi.python_interpreter
super(_ConvertImage, self).__init__(
name='%s-Convert_Image-%s' % (task_type, task_id))

View File

@ -15,7 +15,6 @@
import json
import os
import sys
from unittest import mock
import glance_store
@ -266,16 +265,9 @@ class TestConvertImageTask(test_utils.BaseTestCase):
image_convert.revert(result=mock.MagicMock())
self.assertEqual(1, mock_os_remove.call_count)
def test_image_convert_interpreter_resolution(self):
# By default, wsgi.python_interpreter is None, which we should
# translate to sys.executable at runtime.
convert = image_conversion._ConvertImage(self.context,
self.task.task_id,
self.task_type,
self.wrapper)
self.assertEqual(sys.executable, convert.python)
# If overridden, we should take the interpreter from config.
def test_image_convert_interpreter_configured(self):
# By default, wsgi.python_interpreter is None; if it is
# overridden, we should take the interpreter from config.
fake_interpreter = '/usr/bin/python2.7'
self.config(python_interpreter=fake_interpreter,
group='wsgi')

View File

@ -15,7 +15,7 @@ sqlparse>=0.2.2 # BSD
alembic>=0.9.6 # MIT
httplib2>=0.9.1 # MIT
oslo.config>=8.1.0 # Apache-2.0
oslo.concurrency>=3.26.0 # Apache-2.0
oslo.concurrency>=4.5.1 # Apache-2.0
oslo.context>=2.22.0 # Apache-2.0
oslo.upgradecheck>=1.3.0 # Apache-2.0
oslo.utils>=4.7.0 # Apache-2.0