Changes block_device_mapping extension into v2.1

This patch changes v3 block_device_mapping API to v2.1 and make
unittest share between v2 and v2.1

The differences between v2 and v3 are described on the wiki page
https://wiki.openstack.org/wiki/NovaAPIv2tov3.

Partially implements blueprint v2-on-v3-api

Change-Id: I935b336523241a32dbd2bb8b154ce72afefd3aa9
This commit is contained in:
He Jie Xu
2014-08-19 12:43:59 +08:00
parent 62a8e4e47d
commit e2fd04e281
4 changed files with 49 additions and 126 deletions

View File

@@ -22,7 +22,7 @@ from nova import block_device
from nova import exception
ALIAS = "os-block-device-mapping"
ATTRIBUTE_NAME = "%s:block_device_mapping" % ALIAS
ATTRIBUTE_NAME = "block_device_mapping_v2"
class BlockDeviceMapping(extensions.V3APIExtensionBase):

View File

@@ -545,7 +545,8 @@ class ServersController(wsgi.Controller):
exception.SecurityGroupNotFound,
exception.PortRequiresFixedIP,
exception.NetworkRequiresSubnet,
exception.NetworkNotFound) as error:
exception.NetworkNotFound,
exception.InvalidBDMVolumeNotBootable) as error:
raise exc.HTTPBadRequest(explanation=error.format_message())
except (exception.PortInUse,
exception.NetworkAmbiguous,