diff options
| author | Vishvananda Ishaya <vishvananda@gmail.com> | 2012-08-03 19:31:48 -0700 |
|---|---|---|
| committer | Vishvananda Ishaya <vishvananda@gmail.com> | 2012-08-09 08:00:48 -0700 |
| commit | 2640f81754126c9d3ecd668eb99fb006f68b709b (patch) | |
| tree | f9c157f95ed976f4c7a9040eac439180a1eeb65d /nova/api | |
| parent | d0189e777097a3adc5cf030123adfc24c67d14b4 (diff) | |
Key block_device_mapping off of volume extension
partially implements blueprint disable-server-extensions
Instead of creating a child controller for boot from volume,
key the post parameter of of the os-volumes extension.
Change-Id: I0dd233c2ae12a09d6fc59c49042c2f8b83f3fdba
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/compute/contrib/volumes.py | 11 | ||||
| -rw-r--r-- | nova/api/openstack/compute/servers.py | 11 |
2 files changed, 4 insertions, 18 deletions
diff --git a/nova/api/openstack/compute/contrib/volumes.py b/nova/api/openstack/compute/contrib/volumes.py index 8dc16fcdc..e566a95f7 100644 --- a/nova/api/openstack/compute/contrib/volumes.py +++ b/nova/api/openstack/compute/contrib/volumes.py @@ -19,7 +19,6 @@ import webob from webob import exc from nova.api.openstack import common -from nova.api.openstack.compute import servers from nova.api.openstack import extensions from nova.api.openstack import wsgi from nova.api.openstack import xmlutil @@ -428,13 +427,6 @@ class VolumeAttachmentController(object): return {'volumeAttachments': results} -class BootFromVolumeController(servers.Controller): - """The boot from volume API controller for the OpenStack API.""" - - def _get_block_device_mapping(self, data): - return data.get('block_device_mapping') - - def _translate_snapshot_detail_view(context, vol): """Maps keys for snapshots details view.""" @@ -597,8 +589,7 @@ class Volumes(extensions.ExtensionDescriptor): collection_name='servers')) resources.append(res) - controller = BootFromVolumeController(self.ext_mgr) - res = extensions.ResourceExtension('os-volumes_boot', controller, + res = extensions.ResourceExtension('os-volumes_boot', inherits='servers') resources.append(res) diff --git a/nova/api/openstack/compute/servers.py b/nova/api/openstack/compute/servers.py index d70323cbf..6756338d8 100644 --- a/nova/api/openstack/compute/servers.py +++ b/nova/api/openstack/compute/servers.py @@ -375,13 +375,6 @@ class Controller(wsgi.Controller): raise exc.HTTPNotFound() return servers - def _get_block_device_mapping(self, data): - """Get block_device_mapping from 'server' dictionary. - - Overridden by volumes controller. - """ - return None - def _add_instance_faults(self, ctxt, instances): faults = self.compute_api.get_instance_faults(ctxt, instances) if faults is not None: @@ -654,7 +647,9 @@ class Controller(wsgi.Controller): availability_zone = server_dict.get('availability_zone') - block_device_mapping = self._get_block_device_mapping(server_dict) + block_device_mapping = None + if self.ext_mgr.is_loaded('os-volumes'): + block_device_mapping = server_dict.get('block_device_mapping') ret_resv_id = server_dict.get('return_reservation_id', False) |
