Fix bad typo in cloudpipe.py

Looks like a refactoring problem. we should be raising
exc.HTTPBadRequest where exc is in webob.

Change-Id: Id6d4e1d43f1d49c05d9da1234e40a603022d35c2
Add nova.db.migration.db_initial_version()

Updates Nova to use a new function called db_initial_version()
instead of the INIT_VERSION constant. This allows us to
move the top level INIT_VERSION = 132 into the
sqlalchemy migration.py implementation where it belongs.

Also, includes changes to do the same for the Nova
baremetal migrations.

Change-Id: I10dacdebb50d3121e3bfd094e40138807233aa64
Pass thru credentials to allow re-authentication

Nova's network client obtains a token from keystone for authenitcation
to the neutron services.  When the timeout of keystone is set low, it
creates a condition where some of the invocations to neutron start
failing.

This is because the neutron client detects that the token is expired,
but during the re-authorization attempt fails due to not having enough
information to properly reauthorize.  Nova also assumes that within a
given context, the token will always be valid.  It does not perform the
authorization check (and doing so would be double verification as the
neutron client is already validating this).

Since the neutron client has logic in place to re-authorize the token,
this change set will pass thru the credentials to the neutron client
for the re-authorization attempts.  This change also updates the unit
tests.

Note: the change only will pass in the admin credential information
if the context indicates that it is an admin.

Change-Id: I2858562b180f3e058a2da9d67bef02af80927177
Closes-Bug: #1241275
Utilizes assertIsNone and assertIsNotNone - tests/api

Using assertTrue and the 'is None' operator to test if an element is None
is too python2.4. Our unit testing framework 'testtools' supports
assertIsNone and assertIsNotNone, included from python 2.7,
which were created for these types of tests.

Change-Id: I09f38e219931e0d7ad27f04861d1ebbc3b5e2c5f
Add DeleteFromSelect to avoid database's limit

nova-manage db archive_deleted_rows fails if max_rows is a large
number. Database has a limit of maximum sql variables in one SQL
statement. It is more efficient to insert(select) directly and then
delete(same select) without ever returning the selected rows back to
Python. This also can avoid database's limit.

Closes-Bug: #1214720

Change-Id: I29e3a5ce14c59dd2979e45e8d31fc3df04c70266
clean up numeric expressions in tests

Replace numeric expressions with constants in nova/tests
to make code more readable.

Implements: blueprint byte-unit-clean

Change-Id: Ic074ab07fa84b32805647201cd5ff433f3e7949c
Add ephemeral_mb record to bm_nodes

As the first step in making  baremetal support ephemeral partitions the
baremetal db needs to keep track of the ephemeral disk size.

Change-Id: I990f02a37799f4d9a3bde39a6058641a4a5314a4
Partial-Bug: #1238311
xenapi: workaround for failing vbd detach

Sometimes xapi returns with an internal error during unplug_vbd. This
patch adds a workaround for XenServer 6.2 by inspecting the error
message, and retry the unplug.

In addition, this also ensures that sleep is no longer called after the
last retry before raising an exception.

Fixes bug 1217972
Change-Id: I7b86325714e38b00a2f51bbf083b5532a6c51fa9
Adds V3 API samples for user-data

Adds V3 API sample tests and api samples for user-data

Partially implements blueprint v3-api-unittests
Partially implements blueprint v3-api-specification

Change-Id: I3a29490061632d7f728edcb942a061c3b65518bd
Pass volume_api to get_encryption_metadata

The module encryptors was creating a volume API instance in the module
scope which caused all the modules importing it to depend on
cinderclient.

This was affecting scheduler and cert services which at some point import
the compute manager module only to access their config options. It makes
no sense to force scheduler and cert services to require cinderclient.

This patch makes the callers of get_encryption_metadata to pass the
volume api object to this method to prevent this dependency.

Closes-Bug: #1246103
Change-Id: I9eb4ae3754fa2a5ac646560a62477d6ed672e272
Merge "Add nova.db.migration.db_initial_version()"
Merge "Pass volume_api to get_encryption_metadata"
Merge "Add ephemeral_mb record to bm_nodes"
Merge "Add DeleteFromSelect to avoid database's limit"
Make virt/firewall use objects for Security Groups and Rules

This makes the virt/firewall module use SecurityGroup and
SecurityGroupRule objects instead of relying on virtapi and
conductor for these operations.

Related to blueprint compute-manager-objects
Related to blueprint virt-objects

Change-Id: I39cb9422cb15e6222f5009f64706f1528035f42d
Remove security_group-related methods from VirtAPI

This patch removes the no-longer-needed security_group-related
methods from VirtAPI.

Related to blueprint compute-manager-objects
Related to blueprint virt-objects

Change-Id: I0326f25754e7a13dfc18f207242052412189c743
Merge "Utilizes assertIsNone and assertIsNotNone - tests/api"
Merge "Fix bad typo in cloudpipe.py"
Merge "Pass thru credentials to allow re-authentication"
Merge "xenapi: workaround for failing vbd detach"