From 3c132c028a089936eb205079ad239347bc1a0dd9 Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Thu, 2 May 2013 09:44:30 +0100 Subject: Copy Nova's workaround for RHEL6 eventlet issue The eventlet on PyPI basically doesn't work on RHEL because we (Red Hat) screwed up by not taking monkey patching into account when backporting an API from python 3. This is the series of events: 1) We backported a patch to RHEL6 from Python 3 which added an optional 'timeout' argument to subprocess.Popen: http://pkgs.devel.redhat.com/cgit/rpms/python/commit/?h=rhel-6.3&id=fc9a3f0e07 This might sound innocuous but it means the wait() function get called with a timeout argument 2) eventlet overrides this function, but doesn't know about the timeout argument, so it fails. To reproduce, try applying this to your python 2.7: https://gist.github.com/markmc/5500967 3) eventlet doesn't yet support Python 3, so the only time this issue crops up is if you use eventlet on RHEL6 4) We've fixed eventlet in EPEL6, but the issue still remains if you install eventlet from upstream 5) Dave Malcolm sent a pull request to eventlet, but it has stalled: https://bitbucket.org/eventlet/eventlet/pull-request/30/add-dummy-timeout-parameter-to Nova has long had a nasty workaround to patch eventlet in our virtualenv and we now need this workaround in oslo-incubator to test processutils. Let's add it here and make nova sync it from oslo-incubator. I really hope we can get eventlet upstream "fixed" and the fix released soon. When that happens, we can kill all this nastiness. Change-Id: I62ce43a330d7ae94eda4c7498782a655e63747fa --- tools/patch_tox_venv.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 tools/patch_tox_venv.py (limited to 'tools') diff --git a/tools/patch_tox_venv.py b/tools/patch_tox_venv.py new file mode 100644 index 0000000..e23cf74 --- /dev/null +++ b/tools/patch_tox_venv.py @@ -0,0 +1,38 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2013 Red Hat, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import os +import sys + +import install_venv_common as install_venv + + +def main(argv): + root = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) + + venv = os.environ['VIRTUAL_ENV'] + + pip_requires = os.path.join(root, 'tools', 'pip-requires') + test_requires = os.path.join(root, 'tools', 'test-requires') + py_version = "python%s.%s" % (sys.version_info[0], sys.version_info[1]) + project = 'oslo' + install = install_venv.InstallVenv(root, venv, pip_requires, test_requires, + py_version, project) + #NOTE(dprince): For Tox we only run post_process (which patches files, etc) + install.post_process() + +if __name__ == '__main__': + main(sys.argv) -- cgit