Ask Your Question

rconradharris's profile - activity

2013-06-06 18:27:10 -0500 answered a question Why do V3 API tests fail when run using nose but not run_tests.sh?

Answered this myself.

2013-06-06 18:26:45 -0500 asked a question Why do V3 API tests fail when run using nose but not run_tests.sh?

Just ran into this issue, so capturing the answer here for posterity.

In the past, you could run the tests with:

nosetests

and everything worked fine.

If you try that now, however, you may notice that some V3 API tests fail. Strangely, the tests will pass if you run them under tox or run_tests.sh.

Solution

Set the PYTHONPATH to you nova root directory, most likely your current-working directory like so:

PYTHONPATH=. nosetests

Reason

The V3 API uses stevedore to load plugins, which in turn uses entry points.

pkg_resources, the standard-library module for finding these entry-points keys off of sys.path.

The problem is that, when the nosetests binary is run, its current-working directory is something like '~/.virtualenvs/openstack/bin'. This means that it won't find the nova package in your current working directory.

To force it to find it, we can add the current directory to the sys.path by explicitly setting PYTHONPATH.

2011-06-08 21:07:24 -0500 answered a question nova-manage db sync failed

I received this error when I pip installed migrate instead of sqlalchemy-migrate. To fix I did:

pip uninstall migrate pip install sqlalchemy-migrate

2011-03-14 15:00:48 -0500 answered a question Unit test failing on dev machine

novaclient is now required by the tests; to fix this you can run:

pip install python-novaclient.

2011-02-28 22:32:26 -0500 answered a question Eventlet crashes because of subprocess

The issue is discussed here:

https://bitbucket.org/which_linden/eventlet/issue/77/subprocess-module-fails-if-os-module-is (https://bitbucket.org/which_linden/ev...)

You have two routes:

  1. Use the ppa

  2. Apply the patch included in the link. You can do something like:

pushd /usr/lib64/python2.6/site-packages/eventlet curl https://bitbucket-assetroot.s3.amazonaws.com/which_linden/eventlet/20110214/77/greenpipe-wrap.patch (https://bitbucket-assetroot.s3.amazon...) | patch popd

P.S.

(Asking and answering my own question to document this issue for posterity. And karma. Lots of karam.).

2011-02-28 22:25:20 -0500 asked a question Eventlet crashes because of subprocess

The current version of Eventlet has a bug in it related to its interaction with the subprocess module.

It will generate a stacktrace like:

(nova): TRACE: stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env) (nova): TRACE: File "/usr/lib64/python2.6/site-packages/eventlet/green/subprocess.py", line 31, in __init__ (nova): TRACE: wrapped_pipe = greenio.GreenPipe(pipe, pipe.mode, bufsize) (nova): TRACE: File "/usr/lib64/python2.6/site-packages/eventlet/greenio.py", line 376, in __init__ (nova): TRACE: raise TypeError('f(ile) should be int, str, unicode or file, not %r' % f) (nova): TRACE: TypeError: f(ile) should be int, str, unicode or file, not <open greenpipe="" '<fd:4="">', mode 'wb' at 0xf54ea8>