95 Commits

Author SHA1 Message Date
Alexei Kornienko
7975b465d0 Switch to use oslo.db
oslo.db first stable release has been cut and we can start using it
instead of openstack/common/db/* code which is now marked obsolete.

Change-Id: Ib350e8d1dcec3be707e3b1679c70202619256269
2014-07-21 16:10:41 +03:00
John Griffith
116f54dbf1 Update cinder generate_sample script
Cinder's generate sample script has fallen a
bit out of date and was no longer working properly
in local venv.

This patch updates it with a working version that
reads the rc file and makes some other updates.

Even better, we'll update the tox.ini file here so
that it actually works, and finally add some more
info to the error message when update check fails
to make is obvious how to run these appropriately.

Change-Id: I2389910d8ece6f737a9609ce4aa05263d9293e14
2014-07-15 14:04:34 -06:00
Fengqian Gao
2fad54233d Use six.moves.urllib.parse instead of urlparse
To keep Python 3.x compatibility, use six.moves.urllib.parse to
replace urlparse. tools/lintstack is changed to pass pylint test.

Partial-Bug: #1279611

Change-Id: I0ceaaccbf6c67b45609b4f2f5639c362b32d10ad
2014-03-14 13:17:28 +08:00
Flavio Percoco
f460cbef29 Generate config samples for oslo.messaging
This patch adds oslo.messaging to the
CINDER_CONFIG_GENERATOR_EXTRA_LIBRARIES env variable, which adds
oslo.messaging config options to cinder.conf.sample

Implements blueprint: oslo-messaging

Change-Id: I8aed8a8fdbd5b4ef41e3a3a7dcdebc6f216ec75d
2014-03-11 10:33:45 +01:00
Jay S. Bryant
9550b6b6b4 Sync latest Oslo config code for i18n
This sync pulls the latest Oslo config code over
to Cinder.  This sync is needed to include a fix
to config generator which is needed as part of
the work to enabled i18n messages.  Config generator
was failing when lazy message translation was enabled.

The following changes are included with this patch. Each
patch includes the file(s) the patch touches:
-> c178e56 Add basic Python 3 tests
--> cinder/openstack/common/__init__.py
-> 12bcdb7 Remove vim header
--> cinder/openstack/common/__init__.py
-> 547ab34 Fix Copyright Headers - Rename LLC to Foundation
--> cinder/openstack/common/__init__.py
-> 44b6ea3 Import oslo.config configuration file generator
--> cinder/openstack/common/config/__init__.py
-> dd9aa2b Remove unused variables
--> cinder/openstack/common/config/generator.py
-> 5dce17b Use entry points to discover options in libraries
--> tools/config/generate_sample.sh
--> cinder/openstack/common/config/generator.py
-> e8e636c generator: add an EXTRA_LIBRARIES env variable
--> cinder/openstack/common/config/generator.py
-> e3dddd7 generator: use EXTRA_* env vars in the bash script
--> tools/config/generate_sample.sh
--> cinder/openstack/common/config/generator.py
-> 6da13e8 generator: rename EXTRA_MODULES_FILE to RC_FILE
--> tools/config/generate_sample.sh
-> 763eedf Fix DictOpt support in config sample generator
--> cinder/openstack/common/config/generator.py
-> e839886 Config generator fails with lazy messages
--> cinder/openstack/common/config/generator.py
-> 343686b Add check_uptodate to tools/config
--> tools/config/check_uptodate.sh

Oslo version:
-> 0f24d82 Fix migration.db_version when no tables
-> Date: Sat, 22 Feb 2014 00:32:18 +0000

Change-Id: I26a95fe96b08d6340b0fce1b9e2949c8e661a946
Closes-Bug: 1280826
Related-bp: i18n-messages
2014-03-06 10:07:22 -06:00
He Yongli
6427b5506d Use six.moves cStringIO instead of cStringIO
to keep Python 3.x compatibility, use six.moves.cStringIO to
replace StringIO

Change-Id: Id89c6156d9bba0007e8b16cd2cc28413a7cc5fd3
Closes-Bug: #1280964
2014-02-17 15:13:49 +08:00
Dirk Mueller
783e3243f9 Switch to Oslo's config generator
This fixes the sample configuration to contain proper
config groups alongway.

Regenerate sample config with oslo's config generator.

DocImpact: Removes the deprecated memcached_server
option from DEFAULT (now in keystone_authtoken group)

Closes-Bug: #1206650
Closes-Bug: #1260322

Change-Id: I170715bfe6ec7dad9f7317e7bb56cbb68034c4ec
2014-01-02 15:35:16 +01:00
DennyZhang
ff3f2e5735 Remove vim header
No need to set tabstop tons of times, this can be set in your vimrc
file instead.

More disucssion:
http://openstack.10931.n7.nabble.com/Remove-vim-modelines-td21780.html

Partial-Bug: #1229324
Change-Id: Ib3a31c8819ee1950d72f7da5627593623d351560
2013-12-30 18:53:02 -06:00
Eric Harney
d79ea38c16 Fix ./run_tests.sh -V --virtual-env-name
Currently if --virtual-env-name is specified, the tests fail
because it still creates .venv/ but then looks in the specified
location to use the venv.

This makes --virtual-env-name work as expected.

Change-Id: I036cd08f7b7b9dc87e7012f8dd198a26375297a2
2013-11-22 10:14:22 -05:00
Jenkins
6d59c898ad Merge "Add auth_token settings to cinder.conf.sample." 2013-10-22 02:48:44 +00:00
Xingchao Yu
e5aa6e7273 Fix generate conf script can't handle multistropt
In case MultiStrOpt option's value is empty list, current extract_opts.py
logic will ignore it. This patch aims to update func _print_opt:

add the multistropt's option_name in conf even its value is empty list.

This bug also affects https://bugs.launchpad.net/cinder/+bug/1240783

Closes-bug: #1241348

Change-Id: Ica1da0cd20c97a587964cb0059836d609a440145
2013-10-19 10:09:31 +08:00
Dan Prince
ca81de6583 Add auth_token settings to cinder.conf.sample.
Updates our example config file so that it includes configuration
settings for the auth_token middleware.

A step towards using cinder.conf instead of the api-paste.ini config file
for authtoken configuration.

Once https://review.openstack.org/#/c/52259/ lands I'll push another
review which removes the settings from api-paste.ini (which takes priority).

Related-Bug #1240753

Change-Id: I6636d33ee522757145ac97fc354324a8b9379700
2013-10-18 09:23:38 -04:00
Dirk Mueller
6e7ecda166 Fix all occurences of H404 Hacking warning
This fixes all triggers of hacking 0.6.x's warning:
H404 - multi line docstring should start with a summary.
and enables gating check on H404.

Change-Id: I034bd1f05da3f279d8d79aa14a7f6ce8bef5047c
2013-10-13 10:36:27 +03:00
Jenkins
226b824e73 Merge "Remove option count from sample configuration" 2013-10-13 05:55:19 +00:00
Eric Harney
50d0d65169 Remove option count from sample configuration
This doesn't serve much purpose, and makes it much harder than it
should be to merge multiple patches that change the sample config.

Change-Id: I44895bfbf4a7c9af30040f84b17a97f8e2f4e5b6
2013-10-10 15:02:30 -04:00
Mark McLoughlin
40bfdab75c 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-09 21:39:56 +01:00
Dirk Mueller
45a3b4471d Changed header from LLC to Foundation based on trademark policies
Fixes: Bug 1214176

Change-Id: Ieda1a75992abec647c267faa7727f5da4f7a88a3
2013-09-10 17:26:42 +02:00
Kui Shi
91e2466f2d Add venv wrapper for check_uptodate.sh
tools/conf/check_uptodate.sh is added in run_tests.sh

For simple, run "run_tests.sh -p" will call it, and get following error:

Failed to collect options from module
cinder.volume.drivers.san.hp.hp_3par_common: No module named hp3parclient

Actually, the hp3parclient is listed in test-requirements.txt, and it is
installed in venv.

the check_uptodate.sh should run in venv to get correct result.

update the error message to update the cindier.conf.sample correctly.

-----------
Test method
-----------
$ pwd
/opt/stack/cinder

$ source .venv/bin/activate; tools/conf/generate_sample.sh

(.venv)$ deactivate

$ ./run_tests.sh  -p
Running flake8 ...
// no error emitted here

Fixes Bug #1219197

Change-Id: I9b3eaf3c1a5eb395eefed28bb907685cdef147aa
2013-08-31 19:39:09 +08:00
John Griffith
eafb7c4a2c Add automated check of conf sample
This adds check_uptodate to run_tests and
tox.ini checks.

This also requires that we add novaclient to the
test-requires, since we try and poke at cinder/compute/nova.

There is another implementation in use to do this that
pulls in openstack.common.config.generator,
(see ceilometer project for a pretty slick impl), however
adding that also pulls in a rather large list of
updates and dependencies that quite frankly Cinder
doesn't need and the ones that we do use break
a number of things in Cinder.

There's also a number of additional options added
to generate_sample that I don't think we need right now.

In the future we'll probably want to go this route
but for now I'd just like to get automated checking
in place.

Change-Id: I91aa4d98f472ad5a3ece7773c75ee76d66adafc0
2013-08-26 17:10:48 -06:00
John Griffith
878ac164a3 Fix python 3 pep8 errors for print
The new auto-pulled requirements files exposed
python 3 compat issues in a number of modules.
We added these to tox.ini ignore temporarily,
this change updates the print routines in bin/cinder
and removes the debug cruft that was in the unit tests.

Will update requirements and test-requirements
appropriately in a follow up patch.

Change-Id: I76ea24f4dc1f61c4f8a1d202b0554c90daf2c9cc
2013-08-21 16:59:22 -06:00
Monty Taylor
102c6ea2f0 Sync install_venv_common from oslo
Also grab a related doc reference while we're at it.

Change-Id: I2590970767f043f35a62a4dfa94be4ee86fbf138
2013-07-05 22:37:43 -04:00
Dirk Mueller
64a9dd5c50 Use Python 3.x compatible except: construct
Per (proposed) H203 check, convert all uses of
the deprecated except x,y: construct to except
x as y:, which works with any Python version >= 2.6

Change-Id: I5528dc556f3ef8d356e01d59df04ba57f66c95b7
2013-06-14 23:26:00 +02:00
Michael Kerrin
930f5891b0 Fix up the test framework
When trying to test a bug the cinder test framework was
running all the tests when I just wanted one to run.

Instead of fixing this problem in nose I tried to move cinder to
testr. I copied a fair bit of code from nova to get this to work.
This way at least if some one makes an improvement to the nova
test framework cinder can improve here also.

Note that now all the tests a thread safe. Added a concurrency argument
to run_tests.sh that defaults to 1. You can specify your own level then
and take the risk of intermittent failures. Tell jenkins to use a
concurrency level of 1 to avoid failing gate jobs.

Note One of these tests is broken and I have disabled for now. There
is a bug for this here: https://bugs.launchpad.net/cinder/+bug/1173266

Note: cinder.api.openstack.FaultWrapper is deprecated and is causing
a circular import when I try and import cinder.tests.test_wsgi. This
is fixed by only importing the openstack.FaultWrapper during the
__init__ phase of the wsgi middleware.

Fixes: bug 1183434
Fixes: bug 1177924

Change-Id: I5e10b55c5b236eb81a6a3e0e9ea56af8ca4ef8e1
2013-06-14 14:02:17 +00:00
Dirk Mueller
c9230f2de0 Merge from oslo-incubator
Change-Id: Ie5d9d2c1938e58125b58e64a3363f1e1e8ce2ba2
2013-06-12 19:37:16 +02:00
Jenkins
072cd9c004 Merge "Add error reporting to generate_sample.sh on import failure." 2013-06-02 16:00:28 +00:00
Anton Frolov
27e261376f Add error reporting to generate_sample.sh on import failure.
Currently tools/conf/generate_sample.sh collect options from project
modules by importing each module and looking at it's global variables
for instances of classes derived from cfg.Opt (or lists of such
instances). Sometimes this import can fail due to various reasons,
cfg.DuplicateOptError for example. And if import fails no options
from imported module written to sample config file. Error reporting
will at least warn user that some of options didn't get into sample
config.

Change-Id: I831464b1c1575c106d866a936a50ec74b2d44e59
Fixes: bug #1182611
2013-05-31 14:54:11 +04:00
Zhenguo Niu
15a907c491 Rename requires files to standard names.
Rename tools/pip-requires to requirements.txt and tools/test-requires
to test-requirements.txt. These are standard files, and tools in the
general world are growing intelligence about them.

Change-Id: Ifb2735151dc8c7f89ec01d237226669f7051ffa8
Fixes: bug #1179008
2013-05-31 06:09:05 +08:00
Jay S. Bryant
94220b145c Ensure that pbr>=0.5.10 is installed
A bug in PBR levels less than 0.5.10 causes the
/usr/lib/python2.X/site-packages/cinder/db/sqlalchemy/migrate_repo/migrate.cfg
file to not be properly installed.  This causes 'cinder-manage db sync'
to fail due to the missing file.

This change sets the required PBR level to >=0.5.10,<0.6 to avoid the problem.
In the case that user already has a 0.5.X level of PBR installed that is less
than 0.5.10 it should be updated rather than encountering issues as our
test system did.

Change-Id: I532158277a4acbb2f8cb75d03c91097e6d7e0312
fixes: bug 1182203
2013-05-29 10:12:23 -05:00
Ann Kamyshnikova
9cdccf36c6 Add "_" builtin method for config generation
extract_opts.py fails to generate config without this

bug 1183731

Change-Id: Icf3b45d5d7262607336f5d5e7a0a14b0dee9741d
2013-05-24 13:29:54 +04:00
Monty Taylor
11b184f01d Migrate base test class to testtools.
This is step one in moving towards testr.

Change-Id: Ieac7fbe34ddc9ca05812faca76b68ff7d37ca708
2013-05-23 19:24:02 -06:00
John Griffith
647aab40a4 Update log.py and jsonutils.py from oslo-incubator
The update of log was mostly to get coloring to work again
in devstack, and jsonutils was picked up as well.

The update to jsonutils also requires the six dependency
which is added to pip-requires.

Change-Id: I95d23aafe19b12d4a427149aa5f7a66394d178c6
2013-05-22 14:15:25 -06:00
Monty Taylor
c23f620f2c Use flake8 and hacking.
Fixes bug 1172444

Change-Id: I46b733bd16fa49c58c642348988233064d2b673b
2013-05-11 16:20:23 -04:00
Monty Taylor
381049bc03 Use pbr instead of openstack.common.setup.
Fixes bug 1179007

Change-Id: I71a556bcc36e56f0b51b1191f2622c66c3338474
2013-05-11 16:20:19 -04:00
Yun Mao
d75fafa88f Add pylint-based lintstack test to tox environment
lintstack is a pylint-based static analysis tool to find bugs
in Python code.

To run the test via tox: $ tox -e pylint
To run the test directly: $ tools/lintstack.sh

Change-Id: If155f47ed84eb820ac505ee741bdd18edd41b1eb
2013-05-10 07:22:05 -04:00
Jenkins
116493092c Merge "Copy the RHEL6 eventlet workaround from Oslo" 2013-05-09 05:34:06 +00:00
Mark McLoughlin
d52a0f21f7 Copy the RHEL6 eventlet workaround from Oslo
Tests in oslo-incubator now need the horrendous hack to workaround an
issue with eventlet on RHEL6. We've moved the patch_tox_venv tool
and redhat-eventlet.patch into oslo-incubator, so add them to
openstack-common.conf.

Change-Id: I1acfec282b64d7582144b155119bedb1741db2f7
2013-05-02 10:22:26 +01:00
Chuck Short
7546682d90 Remove setuptools-git as run time dependency
Remove setuptools-git as a run time dependency since
it is only used to generate a tarball.

Change-Id: I6c48147408e97ab88ede660938e783f6b660746a
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2013-05-01 14:13:59 -05:00
Darren Birkett
2c540b3fa4 new cinder.conf.sample and fix extract_opts.py
Fixes bug: #1167329

Change-Id: I09ce8f00c84a5a04d6e4274914fed102f19381e1
2013-04-11 08:46:10 +01:00
Mark McLoughlin
ae4aecdc7e Remove unused tools/rfc.sh
This has been deprecated in favour of git-review for quite a while now
and was removed from Nova 10 months ago.

Change-Id: Ic4bfa1aee3a4b6a7588be3678ac033a1b13e2b18
2013-03-25 21:57:01 +00:00
Walter A. Boring IV
eae0264782 Update Cinder's latest copy of OSLO grizzly stable
This patch updates all the files from oslo under
stable/grizzly but policy.py.  policy.py is a high risk
change at this date and it has lots of changes since the
last time we updated it.

Fixes bug #1157126

Change-Id: I399a1cd8474f718ed5196def90d2fea546fb01f5
2013-03-20 14:55:55 -07:00
john-griffith
2132f7a1a3 Use OpenStack common project requires.
This patch is an update of pip-requires and test-requires
using the openstack/requirements script.

One exception was made to pep8, which is being fixed in the
upstream script.

Change-Id: I4bd61e0ec6f1995f9f36a724eb8dbe15345caca0
2013-03-19 16:24:59 -06:00
john-griffith
7bb449aa5a Remove AGPL rtslib pkg from pip-requires.
Fixes bug: 1157091

Change-Id: I1879712ab33324740496b284500fa2b22a1bc310
2013-03-19 09:03:38 -06:00
Mark McLoughlin
b7bccb9c9b Switch to final 1.1.0 oslo.config release
Fixes bug #1128256

oslo.config has now been released to PyPI in time for Grizzly RC1 so
we can switch to using it directly.

Change-Id: I655f831718ae5f4e25e941ee206fe195214a9a91
2013-03-12 16:33:53 +00:00
Dan Prince
cb904d0d4c Update tox.ini to support RHEL 6.x.
In order to support running unit tests on RHEL 6.x we need to patch
eventlet with contrib/redhat-eventlet.patch. We already
have support for this in the tools/install_venv_common.py but we
need to make a couple changes to allow tox to consume this:

1) Sync in the latest intall_venv_common.py from oslo. This changes
 patch to use the -N option (ignore already applied patches) and
 makes it safe to call the patching function more than once.

2) Add a new patch_tox_venv.py script in tools.

3) Update tox.ini to call patch_tox_venv.py before it runs tests and
 coverage.

NOTE: This will hopefully go away eventually once this patch lands:

 https://bitbucket.org/eventlet/eventlet/issue/89/add-a-timeout-argument-to-subprocesspopen#comment-3342969

Change-Id: I3e2b07c3f718e4aede5c5f231ff0cdb7721ec885
2013-03-08 08:56:48 -05:00
Dan Prince
a4bc4d34fb Switch to oslo.config.
The oslo-config package has been renamed. Switch to the new
version. (should fix SmokeStack).

Change-Id: Ic8cc9f53b7c4713e7bce7db47ad2021912d3b5db
2013-03-05 22:29:35 -05:00
Sean Dague
614a23a9c5 update install_venv_common to handle bootstrapping
old install_venv_common used oslo-config, which makes for bad
recursive dependencies, and we can't build a venv from a fresh
tree.

Change-Id: I09336d760842d4eb57f2b70fdfe19afaf6520a48
2013-02-22 15:02:57 -05:00
Jenkins
44cd8bd2f7 Merge "XenAPINFS: Create volume from image (generic)" 2013-02-21 07:34:03 +00:00
Duncan Thomas
f50c8cbed1 Implement a basic backup-volume-to-swift service
Implements: blueprint volume-backups

This patch adds the new service, api and basic unit tests

Change-Id: Ibe02c680c5e9201d208c92e796e86ad76b4b54b3
2013-02-21 00:00:30 +00:00
Mate Lakat
f2ce6984b7 XenAPINFS: Create volume from image (generic)
Fixes bug 1130706

Related to blueprint xenapinfs-glance-integration

This patch enables users to use any images recognised by qemu-img to
create volumes on XenAPINFS.

Change-Id: I9dd8ec237309da82ec7f73db1acb48e5b7411c9e
2013-02-20 18:14:50 +00:00
john-griffith
ea2c40542f Bump the oslo-config version to address issues.
Cinder unit tests weren't running with b3, b4 has some
fixes that put things back on track.

Change-Id: I7f8b7e1ab688790577d5ea3e95b4b20c6e552fae
2013-02-20 10:17:21 -07:00