41 Commits

Author SHA1 Message Date
Andreas Jaeger
9cd58e5741 Silence tox warning
tox -e genconfig and tox -e pylint both will generate a warning like:
WARNING:test command found but not installed in testenv
  cmd: /bin/bash
  env: /home/aj/vcs/OpenStack/openstack/manila/.tox/genconfig
Maybe forgot to specify a dependency?

Whitelist bash to remove the warning.

Change-Id: Ibab38ce2308760c7089d5d3e298bfc642367e7b4
2014-10-21 09:37:15 +02:00
Jenkins
a7128d5404 Merge "Remove extra flake8 args" 2014-10-21 03:01:38 +00:00
Andreas Jaeger
54d12cab61 Remove extra flake8 args
By default, flake8 checks the current directory and its subdirectories,
so it tests already for "." - and "manila/common" is a subdirectory of
it.  Thus remove "." and also "manila/common" as subdirectory. Right now
"manila/common" gets tested twice - as part of "." and separate.

Closes-Bug: #1383154
Change-Id: Ie187686bd8b9e9981b2556c1d394fa9a9ca63915
2014-10-20 08:05:07 +00:00
Andreas Jaeger
7b659fc4e0 Use oslo.i18n
oslo.i18n provides the i18n function that were provided by
oslo-incubator's gettextutils module

Import _ where needed, oslo.i18n deprecated the builtin method.

Closes-Bug: #1382187
Change-Id: I12aa1c725aa4bb52a9aa46e9c3d2b303839de48b
2014-10-19 19:21:03 +02:00
Valeriy Ponomaryov
e089a1bc6f Remove hash seed dependency for unittests
latest tox has random hash seed enabled, that causes
unstable unittests errors.

Change-Id: I0e24304ca045c5347aa9fd97ee28ac3be774fa31
Closes-Bug: #1359982
2014-08-27 18:59:20 +03:00
Andreas Jaeger
2641eb9b57 Flake8: Fix and enable H405
Fix H405:
H405  multi line docstring summary not separated with an empty line

With this patch, flake8 passes all checks (incl. hacking checks)
except the on-purpose disabled check H904.
Closes-Bug: #1333290

Change-Id: If41259aefc4d6d588da5036f1f25df17b88db04f
2014-08-27 13:39:22 +02:00
Andreas Jaeger
1ee54a3144 Flake8: Fix H501
Fix all occurences of:
H501  Do not use locals() for string formatting

Change-Id: Id221d257975659d31b29ed696345f96525c3b459
Partial-Bug: #1333290
2014-08-27 10:47:56 +00:00
Andreas Jaeger
8203c51081 Flake8: Fix and enable H404
Fix and enable flake8 test H404:
H404  multi line docstring should start without a leading new line

Change-Id: I13dc13bb5e81d65300680df094cde538c7a6f6df
Partial-Bug: #1333290
2014-08-27 10:47:45 +00:00
Andreas Jaeger
4a49b5e562 Flake8: Fix E128
Fix and enable E128:
E128 continuation line under-indented for visual indent

Partial-Bug: #1333290

Change-Id: I72f673d291c388fc4df19e9585fb02e23c21fec3
2014-08-27 12:46:30 +02:00
Andreas Jaeger
ab96ccb1ef Flake8: Fix H302
Fix H302 and enable the test:
H302  import only modules.'from X import Y' does not import a module

Fix also in the touched files the following:
E128 continuation line under-indented for visual indent

Change-Id: I3116c030a5dc0b5be2b4413beaa460e483215774
Partial-Bug: #1333290
2014-08-26 12:50:59 +02:00
Jenkins
e85bdaca65 Merge "Flake8: Fix F841" 2014-08-26 10:39:25 +00:00
Andreas Jaeger
e1ab0e25c7 Flake8: Fix F841
Enable F841 and fix all issues.

Flake F841 is:
F841 local variable 'XXX' is assigned to but never used

Also fix in changed files some occurences of:
E128 continuation line under-indented for visual indent
H404  multi line docstring should start without a leading new line
H405  multi line docstring summary not separated with an empty line

Change-Id: Ifb08a82d05ac15c8e90f214a96e73d82ff850018
Partial-Bug: #1333290
2014-08-25 08:58:38 +02:00
Jenkins
0886ef51d7 Merge "Remove extra setenv from tox.ini" 2014-08-25 04:20:08 +00:00
Jenkins
ac190572cc Merge "Add specific docs build option to tox" 2014-08-25 04:18:37 +00:00
Thomas Bechtold
e95762398d Add specific docs build option to tox
Add doc venv to align with other OpenStack projects (such as Keystone,
Heat and Nova) who are using 'docs' for their doc builds.

Change-Id: Ib26cdac7142e9ec9efc231a578c14bfc7936ae61
2014-08-23 20:17:09 +02:00
Andreas Jaeger
9154f3e55b Flake8: Fix E126 and E127
Fix these issues and enable E126 and E127:
E126 continuation line over-indented for hanging indent
E127 continuation line over-indented for visual indent

Also fix a few occurences in the touched files of:
E128 continuation line under-indented for visual indent
H405  multi line docstring summary not separated with an empty line

Partial-Bug: #1333290
Change-Id: If822401fc7e1db49d595a0736a0dff8e00dfd217
2014-08-23 08:43:02 +00:00
Andreas Jaeger
290769f087 Flake8: Fix F401
Fix:
F401 'XXX' imported but unused
Add noqa where needed, remove extra imports otherwise.

Remove F401 from ignore list.

Partial-Bug: #1333290
Change-Id: Ib71f0dd001c4e4899200b5e60b3a38e4a6c40555
2014-08-23 08:42:36 +00:00
Andreas Jaeger
2965d59541 pep8: Enable H303 and F403
Remove wildcard imports that are unneeded.
Add #noqa for needed wildcard imports.

Enable H303 and F403 flake8 tests.
Partial-Bug: #1333290

Change-Id: I5974b899bfd0ffbcc6a5dda330693c17cde91317
2014-08-23 10:40:52 +02:00
Andreas Jaeger
6214d01ad9 Remove extra setenv from tox.ini
Remove extra setenv lines that shadow the global setting in the
[testenv] section.

Change-Id: If28ba0df955192bfda53aaf6f81d2c729a51dd7c
2014-08-22 21:40:36 +02:00
Andreas Jaeger
e287c9e263 Enable E121,E122,E123,E124,E125,E129 flake8 tests
Enable the tests and update flake8 comments to note that H904 is ignored
on purpose.

The patch fixes these warnings:
./manila/api/views/limits.py:68:5: E129 visually indented line with same
    indent as next logical line
./manila/share/drivers/netapp/cluster_mode.py:352:13: E122 continuation
    line missing indentation or outdented
./manila/scheduler/scheduler_options.py:98:13: E129 visually indented
    line with same indent as next logical line
./contrib/tempest/tempest/api/share/base.py:210:5: E129 visually
    indented line with same indent as next logical line
./contrib/tempest/tempest/api/share/test_rules.py:32:13: E129 visually
    indented line with same indent as next logical line
./contrib/tempest/tempest/api/share/test_rules.py:90:13: E129 visually
    indented line with same indent as next logical line
./manila/api/views/share_servers.py:28:9: E124 closing bracket does not
    match visual indentation
./manila/api/views/share_servers.py:34:9: E124 closing bracket does not
    match visual indentation
./manila/share/drivers/netapp/driver.py:336:5: E125 continuation line
    with same indent as next logical line

Also fixes other pep8 warnings in these files.

Partial-Fix: #1333290

Change-Id: Ida14ea8f4716e49f7379f929971fd5e462541527
2014-08-22 21:31:47 +02:00
Victor Sergeyev
b081462046 Use opportunistic migrations
Refactored migration tests to use OpportunisticTestCase, removed
unused code, BaseMigrationTestCase class and ``test_migrations.conf``
file.
Added workaround for bug 1359982 to be able to merge this patch.

Closes-Bug: #1359888
Related-Bug: #1359982

Change-Id: Iade2bd2bf50880e167c5a5be8b1236c437f28702
2014-08-22 12:44:33 +03:00
Andreas Jaeger
43aeceff2f Fix H402 hacking rules
Fix and enable hacking test:
H402: one line docstring needs punctuation.

Fix testsuite, the change for manila/tests/api/extensions/foxinsocks.py
needs corresponding changes.

Change-Id: I587cd6771787ca56b1410f86a6ec13380bcc206b
2014-08-19 17:04:54 +02:00
Andreas Jaeger
09b1917fe8 Fix pep8 F811 and F812
Fixes:
manila/scheduler/simple.py:74:45: F812 list comprehension redefines
  'service' from line 59
manila/api/v1/share_networks.py:147:41: F811 redefinition of unused
  'network' from line 29

Do not blacklist these tests anymore.

Partial-Bug: #1333290
Change-Id: Ibf3c170ada17a7af0708331331bc435942c3763b
2014-08-15 15:36:51 +02:00
Thomas Bechtold
c16feaea5e Use common config generator
Delete Manila's implementation located in tools/conf and replace
it with common config generator located in tools/config. The new config
generator include config options from other modules (olso.messaging,
oslo.db, oslo.db.concurrency) which improves the generated sample config.

Change-Id: I553e1a8ec414383e2d79d445ebd10e0e1ffa1ae4
2014-08-12 16:33:06 +02:00
Andreas Jaeger
7d61666a62 Fix F402 pep8
Fix:
./manila/api/contrib/used_limits.py:45:27: F402 import 'quota' from line
19 shadowed by loop variable

Rename the loop variable.

Remove F402 from ignore list since it now passes.

Change-Id: Iaa1f882d0ce1843496283a922b701860746995a2
2014-08-05 15:04:06 +00:00
Andreas Jaeger
518a2491b8 Make flake8 ignore list more fine granular
Instead of ignoring all flake8 specific errors ("F"), list those
codes that currently fail so that they can be addressed one by one
and the currently passing ones will not get added by accident.

Change-Id: Ia40f0d832b70eeb788ae14a84dc0c40cc2e4724f
2014-08-05 15:03:59 +00:00
Andreas Jaeger
e4911b178d Update pep8 testing
Remove comment about H904 since H904 has been removed from hacking,
there's no need to fix it.
Remove E712 ignore since the code is clean.
Remove E711 ignore and fix the problems in manila/db/sqlalchemy/api.py to
make it pass.
Remove H304 ignore since the code is clean.

Change-Id: I4f9477a61d6f1ddde16b5ff9e387c76076c89d6e
2014-07-28 23:09:55 +02:00
Christian Berendt
da0e39f175 Enable check for H237
* H237: module is removed in Python 3

Change-Id: If23059e8c4af05aeede2b5fb239e37bc3f595524
2014-07-25 14:10:31 +02:00
vponomaryov
16a04df3d0 Refactor test framework
Manila's test framework is pretty old and requires update.

Changes:
- usage of nose replaced with testr
- now all the tests are thread safe
- added new options for run_tests.sh, such as --concurrency, --debug, etc...
- new '--concurrency' option for run_tests.sh defaults to 1, examples:
    ./run_tests.sh  # will run in 1 thread
    ./run_tests.sh --concurrency 2  # will run tests in 2 threads
- added tools/colorizer.py for colorizing output of testrun with run_tests.sh
- tests running with tox use as much threads as cores available by default
- examples of testrun with tox:
    tox  # will run test suites defined with 'envlist' in tox.ini, now it is pep8,py26,py27
    tox -epy27  # amount of threads is equal to amount of cores
    tox -epy27 -- --concurrency=2  # amount of threads is 2
    tox -epy27 -- --concurrency=4  # amount of threads is 4
- Added 'Database' class to manila.test module, for more conveniant db testing
- updated policy file 'manila/tests/policy.json' to allow share-network actions
- removed nose-related requirements
- added new requirements for testrepository, subunit

With merge of this change all old installed virtual environments become
incompatible and should be removed with "rm -rf .tox .venv" before testrun.

Implements blueprint testr-with-unittests

Change-Id: I9579ecd538e29d478dbc12adc7dcc33fc668b397
2014-07-22 14:58:48 +03:00
Christian Berendt
799319baab Enabled hacking checks H305 and H307
* H305  imports not grouped correctly
* H307  like imports should be grouped together

Change-Id: I9dc5f995ea07d7c319d944e847a9d1c126937240
2014-07-20 18:48:31 +02:00
Christian Berendt
8c1a574de3 Enable hacking check H236
* [H236] Use six.add_metaclass instead of __metaclass__

Change-Id: I4b943ff57be26c7ca0e7161114c2ef56a6a12df8
2014-07-16 19:12:04 +02:00
Dirk Mueller
6f892ed590 Sync with global requirements
Get requirements in sync with global requirements again.
As this updates hacking to a more recent version, add
some blacklisting of hacking warnings to tox.ini to
get the gate passing. Those will be cleaned up
in followup commits.

Change-Id: I18f956d999db21be197ce35044623eaa22ed4185
2014-07-14 11:15:21 +02:00
Christian Berendt
942503d8ed Enabled hacking check H403
* [H403] Multi line docstrings should end on a new line.

Change-Id: Idd2d40c6304a0f75b192dbbe88c1d81b59dfa957
2014-07-10 16:53:41 +02:00
Christian Berendt
1f3525a3dd Enabled hacking check H401
* [H401] Docstrings should not start with a space.

Change-Id: Ia128f72f8dd209c9f732e7aa7da4b2d2210d9588
2014-07-08 23:17:48 +02:00
Valeriy Ponomaryov
4c9a4808b7 Replace python print operator with print function (pep H233, py33)
'print' function is compatible with 2.x and 3.x python versions

Partially-implements blueprint py3-compatibility

Change-Id: Idea6704be7f49778ca9e99be5b7f449cb89f39dc
2014-07-02 08:56:12 -04:00
Dirk Mueller
c6383f1f16 Switch to Hacking 0.8.x
This brings along Hacking requirements to match
other OpenStack projects. Since hacking already
requires the right pep8 pyflakes etc version,
those dependencies are not necessary to be specified
here.

Change-Id: Ifb575aa549bfd0288e44acda9a750ea40b9d14c2
2014-05-23 00:36:45 +02:00
vponomaryov
cb24cbafeb Replaced manila.conf.sample with README.manila.conf
DocImpact
Closes-Bug: #1314154
Change-Id: I9ab583f3c3bbe8cf43af2e75a36659519f940186
2014-04-29 15:59:07 +03:00
Mark McLoughlin
ae0263e849 Remove obsolete redhat-eventlet.patch
See I62ce43a330d7ae94eda4c7498782a655e63747fa for the gorey details on
why this exists.

As of this fix:

  https://github.com/eventlet/eventlet/pull/34

which was released in eventlet 0.13, we no longer need the patch.

This has now been removed from oslo-incubator, so this is really just
syncing that removal.

Change-Id: I84267f3c6726cb2e750f615e107c48b12c6ed353
2013-10-17 07:11:52 +01:00
Monty Taylor
bbd21eb4cc Remove d2to1 dependency
Change-Id: I9e91070e61e00cbc7d99ff223e85c3c371f60566
2013-09-30 10:48:26 -04:00
Yulia Portnova
9169fc311e docs 2013-09-17 10:57:47 +03:00
Ben Swartzlander
f99ef92c90 Initialize from cinder 2013-08-08 10:34:06 -04:00