32 Commits

Author SHA1 Message Date
Jenkins
69ae5c145f Merge "Various pep8/HACKING fixes for Cinder." 2012-11-15 21:55:26 +00:00
Dan Prince
41c37d3666 Various pep8/HACKING fixes for Cinder.
Fix some ordering/pep8/hacking issues in preperation for re-enabling
full pep8/HACKING checks in tox.

Change-Id: I7151ac73d1ace5d98046580e6d1c6a1dcc6c4cef
2012-11-15 14:11:18 -05:00
Zhongyue Luo
f51e4af121 Remove gen_uuid()
Removed gen_uuid and uuid related unittests
Replaced utils.gen_uuid() with uuid.uuid4()

Change-Id: If34096f47fdea719e2dc180b448654519ede9bc9
2012-11-15 08:04:39 +08:00
Vishvananda Ishaya
4e619fbef8 Fix 401 from auth_token middleware
The openssl popen call to verify the token returns an error code
of 2 when a file doesn't exist. Normally this is caught and the
relevant file is downloaded, but monkeypatching os causes this
error code to be eaten and cinder to return a 401. Note that this
is likely a race condition that depends on exactly when greenthreads
are switching that is causing the return code from Popen to get
overwritten.

It is possible that this is exposing an underlying bug in eventlet
but the workaround is simply to make sure that we don't monkeypatch
os.

Fixes bug 1075838

Change-Id: I69ba75136e32e95c6fdf108f0c4fe21a5e3bdbe6
2012-11-06 20:17:12 -08:00
John Griffith
524c7fa6df Detect and fix issues caused by vol ID migration
The migration from volume ID to UUID neglected to update the provider_location
field on the volume.  As a result the iqn and volume name no long match and
existing volumes are no longer able to be attached after an upgrade
(essex -> folsom and then nova-vol->cinder).

This patch adds a method to the volume driver that will check for the
mismatch of volume name in the iqn during service start up.  If
detected it will update the provider_location field in the database
to include the new ID.  Also it will create a symlink to the device backing
file that also has the correct naming convention.

Note: We don't disturb an connections that are currently attached.
For this case we add a check in manager.detach and do any provider_location
cleanup that's needed at that time.  This ensures that connections
persist on restarts of tgtd and reboot.

Change-Id: I8224824b793c98a9767c5d8dd741d892be720c4f
Fixes: bug 1065702
2012-10-29 16:39:17 -06:00
Eric Harney
b3b1d48d53 Update HACKING.rst and related changes from Nova/PEP8.
Sync up with changes made in Nova, this adds information
about line continuation (PEP8), OpenStack capitalization,
and commit messages.

Change-Id: Id6637307411bcc7a3637ac514c4ec34e26481e0d
2012-10-22 18:41:16 -04:00
Rongze Zhu
f3ecc59364 Change output strings to i18ned
Fixes bug #1069601.

Ensure visible message in cinder-volume-usage-audit got through
translation.

Change-Id: I5c32ce3b2ef2541b8a5520ed53feaf8e00f43c9d
2012-10-22 03:39:04 +00:00
Julien Danjou
186143ecc8 Fix cinder-volume-usage-audit
It seems many point in the internal API and openstack.common changed, but
this binary has been forgotten.

Also, context ie needed when using the notifier, so import it.

This fixes bug #1053502

Change-Id: I306b8671e7b0ed8c2ce2548a51a4c5e6393e13cb
Signed-off-by: Julien Danjou <julien@danjou.info>
2012-09-21 15:17:08 +02:00
Thierry Carrez
730ebab71e Restore SIGPIPE default action for subprocesses
Python ignores SIGPIPE on startup, because it prefers to check every
write and raise an IOError exception rather than taking the signal. Most
Unix subprocesses don't expect to work this way. This patch (adapted
from Colin Watson's post at http://tinyurl.com/2a7mzh5) sets SIGPIPE
back to the default action for cinder.utils.execute and cinder-rootwrap
created subprocesses.

Fixes bug 1053364

Change-Id: I4b3307bd2f0f5d0da529d8b7d80fabae28c57732
2012-09-20 15:26:28 +02:00
John Griffith
321d32379c Add nova migrate_version check to cinder import
Cinder-manage migrate import only works from Nova/Folsom--->Cinder/Folsom
this change adds an explicit check of the nova migrate_version (133)
to make sure we have all of the volume id/uuid changes that are needed
to be compatable, and presents an error message if that's not the case.

Addresses bug #1052598

Change-Id: I7f32cf35e33320f4348b7bc44a8e92b5716b71d8
2012-09-19 09:11:25 -06:00
Rongze Zhu
3e9b64c09e Typo nova => cinder
Change-Id: I715feee8ca84fb65518e750585f82e942e710ecd
2012-09-07 14:25:27 +08:00
Dan Prince
b60c3909ce Several hacking compliance fixes.
Updates bin/nova-manage and the solidfire driver with several
hacking compliance fixes.

Makes it so run_tests.sh -p runs clean again.

Change-Id: Iee675cae06acda6a585a77073e773651aab9d5a1
2012-09-03 22:17:06 -04:00
Dan Prince
560b650fa8 Add cinder- prefix to all binaries.
Renames clear_rabbit_queues and volume-usuage-audit binaries
so that they are prefixed with 'cinder-'.

As part of this change the clear_rabbit_queues binary was changed
to use dashes instead of underscores for consistency with the rest
of the cinder binaries.

Fixes LP Bug #1044386.

Change-Id: I7692a543cc67af2d342a64b84626de38c0a64f81
2012-08-31 09:56:50 -04:00
John Griffith
ca25ea4778 Migrate volume related quota info in db migration
* Fixes bug 1039615
  * Now that quotas are back we need to handle migration
    of volume related quota data in the cinder-manage migrate helper
  * Only resource types transferred are volumes and gigabytes

Change-Id: Idd9aab834612e929683491f47fa1e1861bdbd0d1
2012-08-21 14:05:15 -06:00
Jenkins
f276d01946 Merge "Implements bp migrate-nova-volumes-to-cinder" 2012-08-16 04:48:41 +00:00
Craig Vyvial
6ad360741f Adding the volume notifications to cinder
adding the volume notifications
added unit tests for notifications
added context for notify with rabbit

blueprint cinder-notifications

Change-Id: I5aef1e718eebb9a61e0670d524fcd5f438dee016
2012-08-15 17:21:53 -05:00
John Griffith
11545df5cb Implements bp migrate-nova-volumes-to-cinder
Helper cmds to transition from nova to cinder

  Implements an import section in cinder-manage to transfer
  applicable tables from local or remote Nova database into a
  fresh Cinder database.

  Also implements optional method to copy persistent target files.

Change-Id: I2e655e26c55f1986f3b1554726cead9e73ee9bd6
2012-08-14 16:33:00 -06:00
Thierry Carrez
2b2c97eb5c Deprecate root_helper in favor of rootwrap_config
Align with recent changes in nova-rootwrap by marking the
root_helper option deprecated and introduce usage of the
rootwrap_config option instead. The root_helper option will still
fully be supported in Folsom, but will be removed in Grizzly.

Transition notes: you should replace:
root_helper=sudo cinder-rootwrap /etc/cinder/rootwrap.conf

by:
rootwrap_config=/etc/cinder/rootwrap.conf

Change-Id: I22a6d2bdee6ad2c5ad587ceec574cec4b2887f22
2012-08-03 15:35:03 +02:00
Thierry Carrez
d2d3c9cba4 Port nova-rootwrap changes to cinder-rootwrap
Port recent nova-rootwrap changes to cinder-rootwrap, including:
* Move filter definition from Python module to configuration files
* Fix tests execution on Fedora (bug 1027814)
* Remove executable bit on cinder/rootwrap files

This certainly needs a matching change to devstack to pass gating.

Change-Id: I963bc7890ba285ae515ea61bbd960bd2523f9061
2012-07-23 16:23:55 +02:00
Mike Perez
9a5e830c24 utils module is still being used by cinder-volume service
bug 1026949

Change-Id: I7327d94b5a9f35bc74e179a05976d511c6642a7a
2012-07-20 09:00:51 -07:00
Chmouel Boudjnah
fe716c0ee4 Use openstack.common.log for logging.
- We are not using openstack.common.notifier just yet so handedit
  openstack.common.log to use cinder.notifier now.

Change-Id: I9d912904c53a8ef5d90b4ab5792f5577701b6817
2012-07-20 12:12:12 +00:00
Jenkins
05b661e967 Merge "Remove unused enabled_apis flag" 2012-07-19 16:52:28 +00:00
Russell Bryant
15f971de5b Use rpc from openstack-common.
Final patch for blueprint common-rpc.

This patch removes cinder.rpc in favor of the copy in openstack-common.

Change-Id: I9c2f6bdbe8cd0c44417f75284131dbf3c126d1dd
2012-07-19 17:20:19 +01:00
Russell Bryant
0f362edeb0 Use openstack.common.cfg.CONF.
Part of blueprint common-rpc.

This patch makes the rpc code use the global config object from
openstack-common.  Based on some recent discussions on the mailing list,
this may not be the final way configuration handling is done here, but
it is certainly better than the register_opts() hack that is removed by
this patch.

Change-Id: Id128126e0bc064a2a1c710c6bd32fb3d137dc7f6
2012-07-19 17:20:18 +01:00
Mark McLoughlin
e435bca718 Use cfg's new global CONF object
Cherry picks 00786bc from Nova.

Implements blueprint cfg-global-object

Replace cinder.flags.FLAGS with openstack.common.cfg.CONF.

In future, we can do a s/FLAGS/CONF/ across the codebase.

Change-Id: If213a4a5da1faf96aac82f34b18d1e0b061495c0
2012-07-19 17:20:18 +01:00
Russell Bryant
22a9da3cc4 Move queue_get_for() from db to rpc.
Part of blueprint common-rpc.

The function queue_get_for() is a utility function used by various
consumers of the rpc API.  This function lived in the db API, but never
ended up using anything from the database.  This patch moves it into the
rpc API so that it can be used by other users of rpc once it moves into
openstack-common.

Change-Id: If92675beecff5471b416a929c161b810e3c71939
Reviewed-on: https://review.openstack.org/9906
Reviewed-by: Vish Ishaya <vishvananda@gmail.com>
Approved: John Griffith <john.griffith@solidfire.com>
Tested-by: Jenkins
2012-07-18 17:27:56 +00:00
Mark McLoughlin
362576f268 Remove 'cinder-manage config convert'
This convers the old flagfile style config files into the the
new .ini style config files. Since Cinder is new and it's first
release will only support .ini style files there's no need for
such a command.

Change-Id: Ie2f4cd8b6f5fc66547a59d39aa3d5eb896b1ddf4
Reviewed-on: https://review.openstack.org/9871
Reviewed-by: Huang Zhiteng <zhiteng.huang@intel.com>
Reviewed-by: Vish Ishaya <vishvananda@gmail.com>
Approved: John Griffith <john.griffith@solidfire.com>
Tested-by: Jenkins
2012-07-18 16:53:17 +00:00
Jenkins
ee669789fe Merge changes Id5a0ffab,If283dd7c,I1a11e8fd
* changes:
  Remove old flagfile support
  Misused and not used config options
  Pass 'cinder' project into ConfigOpts
2012-07-19 08:11:23 +00:00
Mark McLoughlin
ed7e05b008 Remove unused enabled_apis flag
This is only useful in the context of Nova where there are multiple
APIs.

Change-Id: I2339a36b45166a24825882e3e35dd00a2dfb6b27
2012-07-17 04:35:28 +01:00
Ghe Rivero
da97aa46d8 Remove old flagfile support
Cherry-picks 7e3e9b8 from Nova.

Change-Id: Id5a0ffabf7c6eab0bbda1b130a39a6581b26e350
2012-07-16 21:52:59 +01:00
Zhiteng Huang
519bd2451d Convert Cinder to use openstack-common timeutils
This patch is part of effort to get Cinder to use openstack-common
package.  This part is to replace time related functions in utils.py
with 'timeutils' module.

Implement blueprint cinder-common-timeutils

Change-Id: Ic5e9e317a95a7399f0604823eec76b3642a0c1b1
2012-07-13 16:24:44 +08:00
Jenkins
c53d8e343e Initial fork out of Nova. 2012-05-03 10:48:26 -07:00