439 Commits

Author SHA1 Message Date
Matthew Treinish
38c7fa2ab9 Fix import for install_venv.py
On systems that don't use devstack the nova directory
doesn't automatically get added to the python path. This
breaks tools/install_venv_common.py which imports from
nova.openstack.common. This fixes the issue by manually
adding the nova root directory to the python path before
tools/install_venv_common.py is imported.

Change-Id: I8a3df02a51c2c777d8f47cb8bc72d0644ae47095
2013-02-04 10:14:32 -05:00
Jenkins
922f81c18b Merge "import tools/flakes from oslo" 2013-02-02 16:30:17 +00:00
Joe Gordon
2cd4687683 Add 'not in' test to tools/hacking.py
N901: Use the 'not in' operator for collection membership evaluation

Change-Id: Ie156359d85dd089d68eb214f1569f27577800e17
2013-01-31 16:07:09 -08:00
Joe Gordon
64ded79907 import tools/flakes from oslo
Change-Id: Id6d99fe1fd39e8c061f591e9a82058aea9664674
2013-01-31 12:29:14 -08:00
Jenkins
4de4877f74 Merge "Use install_venv_common.py from oslo." 2013-01-31 02:54:43 +00:00
Jenkins
d87c4517cc Merge "Add version constraint for cinder" 2013-01-29 21:24:42 +00:00
Joe Gordon
8af6c6b885 Make sure there are no unused import
Remove all currently unused imports
Prevent future unused imports

Change-Id: I6ac26d5c71b79952a7732db300355a00310c712e
2013-01-28 21:37:32 +00:00
Matthew Treinish
c69ce047ad Use install_venv_common.py from oslo.
This syncs install_venv_common.py from oslo and reworks the
tools/install_venv.py script to use the new library.

Change-Id: I020eae1ec9e3a6aae0ecc7825c0ef723ab247f39
2013-01-28 13:57:59 -05:00
Jenkins
592d46aeb8 Merge "Add version constraint for coverage" 2013-01-28 15:17:38 +00:00
Jenkins
f9012e39ee Merge "Fix hacking N302 import only modules" 2013-01-24 22:59:13 +00:00
Jenkins
113880fe16 Merge "Make failures in the periodic tests more detailed." 2013-01-24 17:38:45 +00:00
Joe Gordon
4845fc2720 Fix hacking N302 import only modules
* Includes some general tools/hacking cleanup
* Fix several N302 cases
* Disable N302 until all cases are fixed

Change-Id: Iddba07ff13e10dc41a6930749044bb8c0572d279
2013-01-24 09:52:58 -05:00
Robert Collins
65f9d214d0 Make failures in the periodic tests more detailed.
The current tests are very opaque when something fails. This change makes the
failure easier to understand without a debugger. The testtools version is
bumped to get a new HasLength matcher.

Change-Id: Iceafa70f88a8cc31a1b0ba912fe32a9fef1b2f18
2013-01-24 21:54:49 +13:00
Jenkins
b1a2b077f1 Merge "xenapi: Add cleanup_sm_locks script" 2013-01-23 17:30:55 +00:00
Stanislaw Pitucha
8087e8d610 Add version constraint for coverage
Python coverage lower than 3.6 causes issues when running the whole
test suite. Some arguments are randomly mixed up with script names,
resulting in unittest failures like this:

UnexpectedMethodCallError: Unexpected method call.  unexpected:-  expected:+
- exists.__call__('/tmp/buildd/.../nova/virt/images.py') -> None
+ exists.__call__('/some/path') -> True

Change-Id: Iadb6d046e3acc75c6ed5abffcfc1abda82aeee4f
2013-01-23 13:11:41 +00:00
Jenkins
a8a0826ea6 Merge "Go back to the original branch after pylint check" 2013-01-23 13:10:50 +00:00
Jenkins
bb108c6bd3 Merge "Sync latest cfg from oslo-incubator" 2013-01-23 12:52:12 +00:00
Jenkins
5309d3cebd Merge "Cleanup of extract_opts.py" 2013-01-23 06:03:50 +00:00
Rick Harris
c8f0720511 xenapi: Add cleanup_sm_locks script
XenServer 5.6 and 6.0 don't appear to be cleaning up sm locks when using
a FileSR. When enough locks accumulate, this causes image related
operations to fail.

This cleanup script is a stop-gap solution that can be run against all
of the dom0's in the cluster to prevent too many locks from
accumulating.

We can remove this script when the root-cause is fixed upstream.

References 1103158

Change-Id: I798bcfeb727a59003910b82d331fdbe031c4a2b4
2013-01-22 23:15:54 +00:00
Stanislaw Pitucha
5cba7edfae Add version constraint for cinder
Cinder client usage requires the "retries" parameter introduced in
cinderclient-1.0.1. This should be a constraint in pip-requires.

Change-Id: I36e8a363c9d4bb7cc4ecfda85644fc4284f17471
2013-01-22 13:05:03 +00:00
Zhongyue Luo
4a04aacef3 Cleanup of extract_opts.py
Moved global variables to the top.
Removed once used variables
Used option type definitions in OPT_TYPES

Change-Id: Ia0bf39933bac84dbf432e6b4590ceb2527e6889c
2013-01-22 14:14:55 +08:00
Robert Collins
bd422b2d1f Unpin testtools.
Change-Id: If760a7b6f8771d9f9ac2722c300032e715e34151
2013-01-22 13:17:04 +13:00
Mark McLoughlin
8d5891e5bc Sync latest cfg from oslo-incubator
The main change is:

  c5984ba Move logging config options into the log module

Re-generate nova.conf.sample to reflect the options move.

Change-Id: I3913ea54465658d93dc56e014dfe5d911b0541d6
2013-01-21 16:57:32 +00:00
Johannes Erdfelt
254333a78d Avoid testtools 0.9.25
Fixes bug 1102400

testtools 0.9.25 introduces a new dependency on the 'extras' package, but
it does so in a way to prevents itself from being installed without the
'extras' package already installed.

Work around the problem for now by avoiding the problematic release.

Change-Id: Ib42ffc67f00db62f9b829069c00476632daae94f
2013-01-21 16:24:20 +00:00
Jenkins
888de921ee Merge "Fix multi line docstring tests in hacking.py" 2013-01-19 14:52:19 +00:00
Jenkins
e03374725f Merge "don't allow crs in the code" 2013-01-18 17:51:06 +00:00
Yun Mao
af5936f4aa Go back to the original branch after pylint check
Previously we save the current commit hash before running lintstack.
This is no problem for Jenkins but not very friendly if we run
lintstack locally. Every time after it's done, git is in detached
HEAD mode. This patch remembers the current branch name and
automatically go back to the branch if available. Otherwise we fall
back to the commit hash.

Part of blueprint lintstack

Change-Id: I145df3027022fc9a8302bc6da9ab300f677f3386
2013-01-17 18:01:43 -05:00
Joe Gordon
2704a40e57 Fix multi line docstring tests in hacking.py
* Fixes N403, along with docstring test
* Adds N404, multi line start
* Disable N403 and N404 until all cases are fixed
* Remove obsolote '--repeat' flag from tox.ini

Change-Id: Ibf6371efc1cdc764e66f6f7c5c4362440101f963
2013-01-17 13:24:31 -05:00
Jenkins
bd8399bd2f Merge "Pull NovaWebSocketProxy class out of nova-novncproxy binary" 2013-01-17 11:59:12 +00:00
Sean Dague
6556b8650f don't allow crs in the code
triggered by this slipping into quantum, now that we have more windows
developers we should ensure that \r\n doesn't land in the code as
a line ending. This check prevents it.

Change-Id: I0a82be0e74915d3c3c25203db110d279580c148b
2013-01-16 18:41:54 -05:00
Jenkins
3c6daa9a0b Merge "Use testrepository setuptools support." 2013-01-16 17:19:37 +00:00
Daniel P. Berrange
e71e8c2a89 Pull NovaWebSocketProxy class out of nova-novncproxy binary
To allow sharing of proxy code between nova-novncproxy and
nova-spicehtml5proxy, pull the NovaWebSocketProxy class
out of nova-novncproxy into a new nova/console/websocketproxy.py
file

Adds previously missing websockify dep to pip-requires.

Blueprint: libvirt-spice
Change-Id: If1334256680e7075598f00ce153cf6f021cc720f
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-01-16 10:19:37 +00:00
Monty Taylor
a0c3e67cb5 Use testrepository setuptools support.
The previous false-positive bug was fixed upstream in 0.0.13.

Change-Id: Iceb07a511992249c104bbc7c34b7c35e01bd9fbd
2013-01-14 23:17:12 -08:00
James E. Blair
9576c6fdeb Revert "Use testr setuptools commands."
This reverts commit c945b71929d7dc872ea27103ca8b6ec3d5cc7cd5
which caused the unit test command to always exit sucessfully.

Change-Id: I410cbc878675503f0ce6e50bddc4fd0552370c46
2013-01-14 14:05:50 -08:00
Sean Dague
313279f99a enable hacking.py self tests
pep8 and hacking.py (by inheritance) have the ability to run self
tests via docstrings, if we format the comments correctly, and change
the docstring test regex. Include self testing in our normal pep8
tests.

fix the comments to actually be test case compliant

fix nova_import_alphabetical to pass on short import lists (only 2
lines, starting at the beginning of a file)

comment where it doesn't appear that hacking.py tests are working
(though there could be deeper black magic in some of them).

fix a doc string in pep8 self tests that breaks N301

fix the fact that pep8 error strings are supposed to start with
\w\d\d\d, we were just lucking out on some formatting because the
string NOVA happened to be only 4 chars long.

Add a couple of escapes so that we don't recursively fail on our
own fail self tests for comments. (boy that's fun)

Change-Id: I14d5e04cfc092b37ec4967cd7485e9975a5eb820
2013-01-14 14:39:49 -05:00
Jenkins
902d75b9b3 Merge "Use testr setuptools commands." 2013-01-14 06:26:24 +00:00
Jenkins
5d478f9606 Merge "Upgrade WebOb to 1.2.3" 2013-01-13 10:01:42 +00:00
Monty Taylor
c945b71929 Use testr setuptools commands.
Replace the embedded shell scripts with setuptools commands provided by
upstream. Cleans up a few warnings that this cause tox to show.

Change-Id: I9eb47142eafb6ed038b358b94984462ca1632542
2013-01-12 13:33:42 -08:00
Jenkins
f8ce2143ba Merge "Fix lintstack check for multi-patch reviews" 2013-01-12 10:13:33 +00:00
Mark McLoughlin
ce27bca549 Try out a new nova.conf.sample format
The current format strikes me as fairly bizarre:

  - Having the help message after the option it's documenting seems
    backwards to me. Compare to the glance or swift samples.

  - Printing the type as e.g. "(StrOpt)" isn't very user friendly

  - We're creating a global pound symbol shortage

Switch to a new format that looks much more like a normal config file.

Change-Id: Ifba0a181667f3b81cad400f1cdd3812e388a9d64
2013-01-10 11:53:52 +00:00
Mark McLoughlin
8365e44856 Regenerate nova.conf.sample
Some pretty monstrous hacking in the extraction tool is required to
guess the group which options are in. It was pretty hacky to begin with
though.

Change-Id: Ie93dcfc82ab19af4e3cb7090bbb03d9efee83aa2
2013-01-10 11:53:51 +00:00
Sean Dague
1d350ba537 fix N402 on tools/
fix N402 (single line docstrings should end in a period)

Change-Id: I2086dfb33a6efeb6ef6edc6a326182b6deda2527
2013-01-09 15:47:22 -05:00
Jenkins
fa4696ff03 Merge "fix N401 errors, stop ignoring all N4* errors" 2013-01-09 01:01:57 +00:00
Yun Mao
477722a849 Fix lintstack check for multi-patch reviews
Some patches in gerrit depend on other patches that are not yet
approved, i.e. not yet landed on master. In this patch lintstack
deals with these cases by currectly generating the right commit
to compare against to further reduce pylint errors.

Part of bp/lintstack

Change-Id: I77622a44949ad2b442d9f2cce6c807e1581830c7
2013-01-08 16:19:32 -05:00
Sean Dague
37bfdd3b38 fix N401 errors, stop ignoring all N4* errors
We had previously been ignoring all our custom N4xx hacking.py
errors. This fixes all the N401 errors "doc strings
should not start with a space" and reduces the ignore set down
to N402 only "single line docstrings should end with period".

It also fixes the N401 parser to catch only docstrings, and
not tripple quoted string blocks used later on in a function.

Clean up a few of the more crazy uses of """ in our code

Clean up additional funky comments to make indents a bit more
consistent, and pull in lines when possible.

Change-Id: I9040a1d2ca7efda83bd5e425b95d1408b5b63577
2013-01-07 21:39:58 -05:00
Doug Hellmann
4ff4edd600 Upgrade WebOb to 1.2.3
The version of WebOb being used in OpenStack was more than
1 year old. This change updates to the latest stable release.

Upgrading WebOb resolves a version conflict between OpenStack
and Pecan, the web framework used by the Ceilometer team for
version 2 of the ceilometer API.

Refer to http://docs.webob.org/en/latest/news.html
for the list of changes between 1.0.8 and 1.2.3.

bug 1092227

Change-Id: Ib5a005665a5b11198006ce2aa2432399a41fc3d9
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2013-01-07 10:47:39 -05:00
Doug Hellmann
64bf6192da Make WebOb version specification more flexible
Change the WebOb version to >=1.0.8 as an temporary
measure to allow the actual version update to 1.2.3
to roll out across the projects one at a time without
breaking the integration tests.

Change-Id: Iea626ff758b352cc5cec2b2c9ab1a3dd3da53bf7
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2013-01-07 10:47:25 -05:00
Dan Prince
a2fd90aca2 Import cfg module in extract_opts.py.
Updates the tools/conf/extract_opts.py module so it
imports cfg again.

Fixes "global name 'cfg' is not defined" errors which occur
without it.

Change-Id: Idf7c2c5201c79e7aa359bc555306caadebcc18ce
2012-12-18 14:40:04 -05:00
Clark Boylan
aef9802089 Replace fixtures.DetailStream with fixtures.StringStream.
Fixtures 0.3.12 adds StringStream as a successor to DetailStream (this
change was made for compatibility with python 3). Update Nova's tests to
use StringStream instead of DetailStream.

Change-Id: If697859a52f3a7db9dab38bd080b779bb3270287
2012-12-16 17:31:46 -08:00
Clark Boylan
4abc8cc64f Use testr to run nova unittests.
Convert nova from using nosetests to testr for its test runner. Some
tests had to be modified to get them to run properly under testr.

run_tests.sh has been updated to run testr instead of nosetests.

Coverage is collected by running subunit.run under coverage.py when the
coverage environment is selected.

Note that you will need to rebuild your virtualenvs as nose is being
removed from the dependency lists and is being replaced by testr. Tests
will run in different processes once this test is merged so you cannot
use test classes to pass information between tests. Each test should be
a proper independent unit. Additionally the -x and -d flags to
run_tests.sh have been removed as there are currently no decent
approximations for those functions.

Change-Id: I019ca098972ca749b195f59968cf21edd5ba9109
2012-12-14 14:22:20 -08:00