29 Commits

Author SHA1 Message Date
Tom Barron
1c2ec9b8cf Detect addition of executable files
When running pep8 checks, fail if executable
files have accidentally been added.

Co-Authored-By: Eric Harney <eharney@redhat.com>

Closes-Bug: 1566328
Change-Id: I7280c0403cd473cd4b88cfc021d4f605a7bb35f2
2016-04-08 14:28:42 +00:00
Tom Barron
72ab1442ad Remove unused logging import and LOG global
This patch removes unused global LOG variable
and logging imports from various manila modules,
and adds a script to be run as part of pep8 that
will ensure that these do not creep back into
the codebase.

Change-Id: I162c4b2478df45aaf6ea8009b102d6de1a4e309e
2016-04-05 07:06:08 -04:00
Tom Barron
334e08121c Add tox fast8 option
This commit ports over the fast8 option from cinder, which enables
one to run pep8 only on one's changeset rather than against the
whole body of code via:
     tox -efast8

Change-Id: Icb0286c3c66983f2f106c163cb11c690b2c57849
2016-02-21 09:19:39 -05:00
David Sariel
4a61faa065 Removed ignored checks from tox.ini and fixed pep8 issues
Due to the hacking version update several pep8 checks where ignored
in the flakes8 section of the tox.ini. Removed ignored checks and fixed
appropriate pep8 issues.

The list of fixed issues:
    - H105 Don't use author tags
    - H238 Old style class declaration, use new style (inherit from `object`)
    - H501 Do not use self.__dict__ for string formatting

Closes-Bug: 1530719
Change-Id: I890ba4c54b0da10060767620ff5ff7e480d79a9c
2016-02-14 14:56:55 +02:00
Clinton Knight
1070ba728e Last sync to Manila from oslo-incubator
Oslo incubator is going away, and we cannot use the sync script
to copy the incubator files to Manila one last time because at
least one file has changed in Manila since the last sync.  This
commit includes the remaining changes which we do want.  The files
are consistent with the oslo-incubator master branch as of commit
305c2b0d52d387c0039e3b3021c4de27e85cd175.

Change-Id: Ib880a0108e4a567ebe39aa1ada7f872c63a818f1
2015-11-20 19:20:21 +00:00
Valeriy Ponomaryov
4778740261 Fix 'cover' tox job
Our 'cover' tox job does not work with release of 'coverage' package v4.0
It fails on option 'ignore-errors' in config section '[report]'.

So, replace usage of this option with CLI option '--ignore-errors'.

Change-Id: I404e3cb63453b0245ac05b4d3cb5780e5b8b7f9a
Closes-Bug: #1497897
2015-09-21 15:09:22 +03:00
Valeriy Ponomaryov
4ea9031b4f Make coverage tox job fail when test coverage was reduced
For the moment we can just calculate coverage and generate html with results.
It would be really useful to be able to get 'failure' by this job, when
latest commit introduced reduction of test coverage by any reason - either
addon of new code not covered with unit tests or deletion of existing unit
tests.
It will reduce total required efforts for code reviewers, that are forced now
to perform such check separately and inform about it committer.

Added file 'tools/cover.sh' is taken from OpenStack Rally project as
of state [1], with couple of fixes for satisfying 'bashate'.

Also add configuration file for coverage package.

[1] I7b4defe187c0631928d70bd09d7bcea956f4eed3

Change-Id: Ie0c5721985ae48256d9bb26af5fdb4b05797b359
2015-07-27 14:53:37 +03:00
Luis Pabón
72d2840048 Enable developers to see pylint output
The program tools/lintstack.py which is executed by
tools/lintstack.sh when Jenkins runs, only tests for differences
in the output of pylint. Right now, there seems to be
17 errors/warnings that are being carried over from fix to fix,
with no difference between fixes, and so no failures in the
pylint Jenkins job.

It is really difficult to tell what the errors are, so this fix
allows developers determine what the errors are by running the
following command:

$ tox -e lint

A sample output of the command is available as an attachment
to the bug.

Change-Id: I88487829576d55d437b934e08571013b7a6e57cf
Signed-off-by: Luis Pabón <lpabon@redhat.com>
Closes-Bug: #1356588
Signed-off-by: Luis Pabón <lpabon@redhat.com>
2015-04-03 15:10:18 -04:00
chen-li
a6a76d6821 py3: use six.moves.urllib.parse instead of urlparse
six is the canonical compatibility library for supporting
Python 2 and 3 in a single codebase.

The urlparse module  was removed in Python 3 and we should
use 'six.moves.urllib.parse' instead of 'urlparse' to make
code compatible with py 2 and 3 as well.

Partially-implements blueprint py3-compatibility

Change-Id: Ib27244d0583e81e307d5e4236cbf85d29566dde9
2014-12-27 08:51:32 +08:00
Andreas Jaeger
0c93feeb5b Sync with oslo-incubator
Remove obsoleted modules from tree.
Sync with oslo-incubator at commit
838a2a31fe009feb2501716d6656eeea426ea357.

The updated lockfile module needs setting of the lock_path option,
ensure that it is set in the testsuite.

Closes-Bug: #1382189
Change-Id: I43ca76a21bd5bdb45f23af9b99b96aefa635ccc1
2014-10-26 08:12:04 +00:00
Andreas Jaeger
883e02f219 Switch to oslo.config
The config module in oslo-incubator has been replaced by oslo.config.
Projects need to switch completely to oslo.config for kilo.

This patch does:
* Register options with oslo.config (new file manila/opts.py)
* Generate the config file using oslo-config-generator
* Remove obsoleted entries for this from openstack-common.conf
* Remove oslo-incubator config files

Change-Id: I30b594423c08782e13a1f615099ae65f997a8551
Closes-Bug: #1382183
2014-10-22 19:55:45 +02:00
Marc Koderer
ecf603bc05 Remove vim headers
As discussed in [1] remove all vim headers from manila files.

[1]: http://lists.openstack.org/pipermail/openstack-dev/2013-October/017353.html

Change-Id: I341486c66ffe4dad7db8608fdc66868ceb7ad95a
Closes-Bug: #1229324
2014-10-06 15:00:27 +02: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
89fa0160a6 Sync scripts with oslo-incubator
Sync all scripts with oslo-incubator (commit fed72f3).

Add scripts also to openstack-common.conf.

Change-Id: I4e595560e002f65d3a6d8e867c17eba04f0a8889
2014-08-14 12:09:46 +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
Thomas Bechtold
347fccd92f Add config module from oslo-incubator
Generated with: `./update.sh --module config --base manila
../../stackforge/manila/` from oslo-incubator, commit fed72f32.
This common code is expected to be used instead of Manila's
implementation located in 'tools/conf'.

Change-Id: I147888ba98ccb2ec98b9ced87b06d8f4766ec361
2014-08-12 15:12:17 +02:00
Valeriy Ponomaryov
8abe92efa9 py3: use six.string_types instead of basestring
six is the canonical compatibility library for supporting Python 2 and 3
in a single codebase.

The basestring was removed in Python 3 and we should use 'six.string_types'
instead of 'basestring' to make code compatible with py 2 and 3 as well.

Partially-implements blueprint py3-compatibility

Change-Id: Idb452afdc2a828089627e14f90c53f3967ceb2ad
2014-07-25 06:02:44 +00: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
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
vponomaryov
07e47e1593 Fix venv installation for run_tests.sh
Change-Id: I24810421f82da3d9d0ba6600b98955f28569a6a8
Closes-bug: 1261518
2014-03-25 12:21:29 +02: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
ubu
9a68e91f9e modified conf sample 2013-09-17 05:24:40 -04:00
Yulia Portnova
9169fc311e docs 2013-09-17 10:57:47 +03:00
Yulia Portnova
4f5dde7db5 Fixed flake8 errors 2013-09-11 12:34:25 +03:00
ubu
59411bf710 Update connfig.sample scripts 2013-09-05 15:25:47 +03:00
Yulia Portnova
4e2f27c11a Replaced cinder with manila 2013-09-04 15:45:32 +03:00
Yulia Portnova
dc4ce932ed Renamed cinder to manila.
Fixed setup.py, fixed bin scripts.
2013-09-02 09:59:07 +03:00
Ben Swartzlander
f99ef92c90 Initialize from cinder 2013-08-08 10:34:06 -04:00