Support building wheels (PEP-427)

Universal is used to identify pure-Python module(by bdist_wheel). For
these, it is sufficient to build a wheel with _any_ Python ABI version
and publish that to PyPI (by whatever means).

Change-Id: Ic22b78ef6434ebf888c92c0a162caeabb70edf88
Make sure "volumeId" in req body on volume actions

We should check whether the parameter "volumeId" is in request body while
attaching a volume to an instance and while swapping volume.

Change-Id: I0be2ae4c80615c0304cd1a0d8ca0a4282a0867c7
Closes-Bug: #1257135
Rename Openstack to OpenStack

Change-Id: Iacc51d8ad071c3b22b7bb6b21cff972599b59a7b
Fix the calls of webob exception classes

The webob exception classes has "explanation" arguments but some
methods calls the classes with invalid arguments. This patch fixes
them.
In addition, this patch changes the error handling of agent_build
_create() because the method raises AgentBuildExists exception only.
The API of v3 has already done it.

Change-Id: I2af5aae297c09ed34fadf6520f1a06228624a5a9
Fix HTTP methods for test_attach_interfaces

delete() method of attach_interfaces API is routed when specifying
"DELETE" as HTTP method, but some tests specify "POST". This bug
does not affect the test behaviors because the tests do not check
API router behaviors and just checks delete() method behaviors.

However, this patch fixes this bug because the bug confuses the
API router behaviors.

Change-Id: I8e862cbd58da820eb336d3ef41185e16f63bb6be
Fix the explanations of HTTPNotFound response

Nova wsgi framework gets "explanation" from HTTPNotFound exception and
outputs it into a response body as "message" attribute. Now some error
explanations are passed to HTTPNotFound exception without explanation
argument and they are not output to a response body. As the result,
the default message "The resource could not be found." of wsgi library
are output to a response body instead.

This patch fixes them to output right message to a response body.

Change-Id: I80d3a2da6258e94c485ce024eb310a63bcf39773
Closes-Bug: #1285437
Added os-security-groups prefix

Added os-security-groups prefix to the security_groups attribute in json response.

Change-Id: Id2a4a92da0c9751abc5c37f06fc2484ba80a8a09
Closes-Bug: #1223309
Fix log messages typos in rebuild_instance function

One log message typos in rebuild_instance function.

Change-Id: I0c86a40b6683f3a8a091134b6f37c82a4562370e
Closes-Bug: #1288661
Rescue API handle NotImplementedError

There are several nova virt drivers that don't implement the rescue API,
but the os compute API doesn't handle NotImplementedError,
it returns a 400 instead of a 501.

The patch add the proper logic to return a 501 instead.

Change-Id: Ia649c4dadd50985efed631ce8f3e4b212646766e
Closes-Bug: #1287367
Add conversion type to LOG.exception's string

Add conversion type for 'String Formatting Operations' to
LOG.exception's string in _get_floating_ips_by_fixed_and_port().

Change-Id: Iec97a354176e3044064bf190735257080be7ae70
Closes-Bug: #1289230
Fixup debug log statements in the nova compute manager

We were mishandling instance logging in a few places.

Change-Id: Ie1ec44fb5092ca9229e037328def52cb6aa81c33
VMware: delete vm snapshot after nova snapshot

When performing a nova snapshot, the vmware driver takes a VM snapshot
and copies out the snapshotted disk. After the operation, the VM
snapshot should be deleted, to prevent growing disk chain(s) on each nova
snapshot.

Closes-Bug: #1252967
Change-Id: I7861ccce0153e45eea0316a2e8dd824210db1660
Fix broken API os-migrations

The return is not what we are expecting:
  migration-list: 'unicode' object has no attribute 'iteritems'

The conversion of the object nova.objects.MigrationList into a list
is not applied automatically.

Change-Id: I1579b1baf62275bf448f23be9465d4e9bc11ed85
Closes-Bug: #1260249
Don't detach root device volume

Detach a root device volume may cause various guest error. Although
we can argue that it's user response to not detach the root device
volume, a check in nova will be more helpful.

We can either give a warning message, or not allow it. This patch
forbids this operation, considering that even in real system, remove
root device does not make much sense.

Closes-Bug: #1279300

DocImpact

Change-Id: I01f086be668b35442a2f139f4d7dc96884a3bda6
Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
Fix docstring for shelve_offload_instance in compute manager

The shelve_offload_instance method in the compute manager is using an
instance object now but the docstring for the instance param said it was
a dict.

Change-Id: I9376f09402ac00e570a58f9b58b2f4aa56a7e16d
Delete meaningless lines in test_server_metadata.py

Some meaningless lines were found in test_server_metadata.py.
I deleted those.

Change-Id: I3f04bc0d4c9048281293ed78e4ba7ea4a2b26864
Make sure instance saves network_info when we go ACTIVE

This makes sure that when we do a save() on our instance during
creation, that we don't save the empty network_info we created
earlier over a potentially-full one built during the process.
This may happen since we wrap the networkinfo in the async helper.
This also moves the network_info.wait() out from under a conditional
which could cover up other issues leading to a case where it is
None (which shouldn't be possible). If we didn't call wait(),
then saving it wouldn't be productive or correct.

Change-Id: I9bd8dd0dce9e17cd128c7495acd52aa82119c57c
Related-bug: 1249065
Remove bad log message in get_remote_image_service

There was a LOG.debug() message in the
nova.image.glance.get_remote_image_service() call that was incorrect and
misleading:

LOG.debug(_("fetching image %s from glance") % image_href)

This function actually does not fetch any image from Glance -- rather,
it is just used to get the default image service object or an image
service object for use with a remote Glance server.

Change-Id: I2b71c2c52d6593ad4677767a6f2bb40c399fe9eb
Closes-bug: #1292984
VMware: enable booting an ISO with root disk size 0

There may be cases where booting from an ISO does not require
any local disk. In this case the flavor may have the root disk
size set at 0.

Change-Id: Id290a0ede11c754f686d3b70322c84c03f161637
Closes-bug: #1292633
Correct inheritance of nova.volume.cinder.API

nova.volume.cinder.API was deriving incorrectly from nova.db.base. This
patch simply removes that unnecessary import and changes
nova.volume.cinder.API to derive from object instead.

Change-Id: I5092b7fbb3780317a09a512aed7ecbe1d57a4428
Closes-bug: #1292997