Add update to volume and snapshot controllers

Add update method to api.openstack.volume.volumes and snapshots
controllers.  Url mapping automatically routes a PUT on the resource to
the update method.  Implementation closely matches updates to server
resource for the openstack compute api.

e.g.

curl http://localhost:8776/v1/${PROJECT_ID}/volumes/${VOLUME_ID} \
    -H 'x-auth-token: ${ADMIN_AUTH_TOKEN}' \
    -H 'content-type: application/json' \
    -XPUT -d '{"volume": {"display_name": "new-name"}}'

Add volume.api.API.update_snapshot method to avoid making db calls
directly from the SnapshotsController.

Add tests for new methods.

Update return value of test_volume.VolumeTestCase._create_snapshot
to return the whole model like _create_volume

fixes lp bug #1042904

Change-Id: I887178f9b7834cc7afd54bba8fb902b630faf8c0
Bump version to 2013.1

Bump version to 2013.1 on master branch to open Grizzly development.

Change-Id: Iad73bf47c4ff77216ee27c3b08117dcaa9487ddf
Merge "Bump version to 2013.1"
Merge "Add update to volume and snapshot controllers"
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
Correct IetAdm remove_iscsi_target

Remove logical units should be done before delete the target while
unexport iSCSI volume. Or ietd will show "No such file or directory"
error.

Fix bug 1043107

Change-Id: Iab5b97044c5a30c788fcabce827923ff82a84b91
Replace builtin hash with MD5 to solve 32/64-bit issues.

It seems that Python's builtin hash returns different
values on 32-bit and 64-bit architectures, so it's
safer to use a well-defined hash like MD5.

bug 1050359

Change-Id: I0a4f11b34a1f76cda279ec801cede1440c6e5966
Merge "Correct IetAdm remove_iscsi_target"
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
Stop double logging to the console

The code in nova for logging added an extra root handler to be
able to log messages to the console during log setup. This handler
was removed in the setup method. The common setup method no longer
removes this handler, so don't create it. Note that there may be
a small period before the logging setup is finished where messages
will not appear.

Fixes bug 1053512

Change-Id: I559cca8ffc2a33beff22025e42a9713487245980
Fixes to the SolarisISCSI Driver

Even when the san_is_local config option was set to false, the
SolarisISCSIDriver's _execute method was accidentally set to
util.execute by the VolumeDriver's __init__ method.

Fix bug 1053041

Change-Id: Ie3299f5065e2b084644ec2956f0c6ebae4264a49
Merge "Fixes to the SolarisISCSI Driver"
Add lun number (0) to model_update in HpSanDriver

The HpSanDriver was not setting the lun number in model_update
and as a result default value of 1 was being used.  Trouble is the
Lun number used by LeftHand is 0, so the connect info would be
wrong and fail when trying to attach the volume.

Fixes bug #1053717

Change-Id: If82a66c6a78ab03da09223a7b79abe559a6f702f
Set the default availability zone back to nova

Currently nova and cinder have to have the same set of az's for
the ec2 api to work properly. Therefore, set the default az for
cinder to nova so they will match.

Includes a hack to az to set cinder to nova to work around gate
issues. The hack can be removed once the gate sets the zone to
nova properly.

Fixes bug 1053508

Change-Id: I9c30ccc5c79b9c4e6c1ebeb3e80d0098e1ffbb11
Remove cinder gating hack

The hack was necessary while we switched the name used for az's
in the gating tests. Now it can be removed

Change-Id: I970205910ac0950ab4a961aa0537eb964d7f0d3c
Merge "Set the default availability zone back to nova"
Merge "Stop double logging to the console"
Merge "Remove cinder gating hack"
Sync with nova change I135ed85a.

This patch syncs the cinder driver code with that of the nova code,
as we received comments in the review process there.  All changes are
minor: (1) removing unnecessary type checks of the flags, (2) not
using getattr to access the FLAGS, and (3) using the self.flags()
infrastructure that test.TestCase provides.

Change-Id: Id740be6441862f048c3a9267394492a7ed65db84
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>