baremetal: Add missing method to volume driver

Added get_hypervisor_version(), which is called by underlying
LibvirtVolumeDrivers. Also added tests roughly checking if the
underlying drivers can be loaded and be called without error.

Partial-Bug: #1208707
Change-Id: Ida6b6800d1ef518c6e76d6b2ab4ac2f795a744ca
Add V3 API sample for admin-password

Adds api sample tests and api samples for admin-password

Partially implements blueprint v3-api-unittests

Change-Id: Iade39ff931471d1d68e358ac5d35a1921e85df66
Adding support for multiple hypervisor versions

This is to prevent instances with newer tools from being provisioned
on older hypervisors.
Added comparison of hypervisor version from the compute-node and image
metadata in the image properties filter.
In host scheduler image_prop_filter, the 'hypervisor_version_requires'
image properties, if available, is compared to the host_state's
hypervisor_version, if available.
hypervisor_version_requires should be added on the image as metadata and
should have a operator and version value.
Examples : ">=6.0", ">6.0, <6.2", ""!=6.1"

Partially Implements blueprint xen-support-for-hypervisor-versions
Cell scheduler changes coming up in another commit.
DocImpact

Change-Id: I6fbf232adf9ac78ebb8ac2985739f163f4517d14
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
Fix tests to work with mysql+postgres concurrently

Optimise tests.db.test_migrations and tests.db.test_migration_utils for
concurrency and make opportunistic tests obey walk_style configurations.

Closes-Bug: 1207750

Change-Id: Idb30f144fb67aefc58749897d774103c3c0ec640
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
Claim IPv6 is unsupported if no interface with IPv6 configured

When IPv6 is supported by glibc but no interface
is configured to use ipv6 (because the ipv6 module
is not loaded), skip ipv6 related checks.

Change-Id: I15aaf3d01f0f51bdc0bd29f30728ca2ab8b5c30a
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
replaced e.message with unicode(e)

BaseException.message has been deprecated as of Python 2.6

Change-Id: I9ac936d707592cd627c57ce56ac67a8da7e55f39
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
Disable nova-compute on libvirt connectivity exceptions

The service will be disabled and re-enabled according to the success
or failure of establishing a connection to the libvirt service.

update_available_resources, periodic task, will probe the connection
even if the service is disabled.

This is in order to avoid migrations or new instances to be scheduled
on a disconnected from libvirt compute node.

Closes-Bug: #1240670
Change-Id: Ib8d67838ceb73c5b1cdc9498c17b335e9e5bb6f3
Remove unused expected_sub_attrs

A leftover from a previous revision of the SecurityGroupRule object and
is now unused.

Change-Id: I21742e23fbd6477bd3d246d64124bbb571b40f94
Merge "replaced e.message with unicode(e)"
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
Merge "Disable nova-compute on libvirt connectivity exceptions"
Merge "Claim IPv6 is unsupported if no interface with IPv6 configured"
Merge "Fix tests to work with mysql+postgres concurrently"
Merge "Remove unused expected_sub_attrs"