From e3d7f1edf958ea9a76ab29d87677f70ffaef2bde Mon Sep 17 00:00:00 2001 From: Chris Yeoh Date: Tue, 4 Jun 2013 21:57:18 +0930 Subject: Port rescue API to v3 Part 2 This patch contains the changes required to adapt the rescue extension and the corresponding unittest to the v3 framework Partially implements blueprint nova-v3-api Change-Id: Iaa6d0cf7708b0887512db952b1e26ccde75d24ef --- nova/api/openstack/compute/plugins/v3/rescue.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/compute/plugins/v3/rescue.py b/nova/api/openstack/compute/plugins/v3/rescue.py index c89d11117..ded18bb1a 100644 --- a/nova/api/openstack/compute/plugins/v3/rescue.py +++ b/nova/api/openstack/compute/plugins/v3/rescue.py @@ -19,15 +19,16 @@ import webob from webob import exc from nova.api.openstack import common -from nova.api.openstack import extensions as exts +from nova.api.openstack import extensions from nova.api.openstack import wsgi from nova import compute from nova import exception from nova import utils +ALIAS = "os-rescue" CONF = cfg.CONF -authorize = exts.extension_authorizer('compute', 'rescue') +authorize = extensions.extension_authorizer('compute', 'v3:' + ALIAS) class RescueController(wsgi.Controller): @@ -82,15 +83,18 @@ class RescueController(wsgi.Controller): return webob.Response(status_int=202) -class Rescue(exts.ExtensionDescriptor): +class Rescue(extensions.V3APIExtensionBase): """Instance rescue mode.""" name = "Rescue" - alias = "os-rescue" - namespace = "http://docs.openstack.org/compute/ext/rescue/api/v1.1" - updated = "2011-08-18T00:00:00+00:00" + alias = ALIAS + namespace = "http://docs.openstack.org/compute/ext/rescue/api/v3" + version = 1 + + def get_resources(self): + return [] def get_controller_extensions(self): controller = RescueController() - extension = exts.ControllerExtension(self, 'servers', controller) + extension = extensions.ControllerExtension(self, 'servers', controller) return [extension] -- cgit