Use plain routes list for os-floating-ips endpoint instead of stevedore

This patch adds os-floating-ips related routes by a plain list, instead
of using stevedore. After all the Nova API endpoints moves to
the plain routes list, the usage of stevedore for API loading will be
removed from Nova.

Partial-implement-blueprint api-no-more-extensions-pike

Change-Id: Iffcd760bc7b9f35596255ab8e59734166eed98af
This commit is contained in:
ghanshyam
2017-05-01 18:39:40 +03:00
parent 98f2071e06
commit 0710fdaf4e
4 changed files with 15 additions and 18 deletions
@@ -201,6 +201,9 @@ hardcoded_extensions = [
{'name': 'FlavorAccess',
'description': 'Flavor access support.',
'alias': 'os-flavor-access'},
{'name': 'FloatingIps',
'description': 'Floating IPs support.',
'alias': 'os-floating-ips'},
{'name': 'Keypairs',
'description': 'Keypair Support.',
'alias': 'os-keypairs'}
@@ -36,7 +36,6 @@ from nova.policies import floating_ips as fi_policies
LOG = logging.getLogger(__name__)
ALIAS = 'os-floating-ips'
def _translate_floating_ip_view(floating_ip):
@@ -327,19 +326,3 @@ class FloatingIPActionController(wsgi.Controller):
msg = _("Floating IP %(address)s is not associated with instance "
"%(id)s.") % {'address': address, 'id': id}
raise webob.exc.HTTPConflict(explanation=msg)
class FloatingIps(extensions.V21APIExtensionBase):
"""Floating IPs support."""
name = "FloatingIps"
alias = ALIAS
version = 1
def get_resources(self):
resource = [extensions.ResourceExtension(ALIAS,
FloatingIPController())]
return resource
def get_controller_extensions(self):
return []
+12
View File
@@ -101,6 +101,10 @@ flavor_extraspec_controller = functools.partial(_create_controller,
flavors_extraspecs.FlavorExtraSpecsController, [], [])
floating_ips_controller = functools.partial(_create_controller,
floating_ips.FloatingIPController, [], [])
server_controller = functools.partial(_create_controller,
servers.ServersController,
[
@@ -191,6 +195,14 @@ ROUTE_LIST = (
('/os-aggregates/{id}/action', {
'POST': [aggregates_controller, 'action'],
}),
('/os-floating-ips', {
'GET': [floating_ips_controller, 'index'],
'POST': [floating_ips_controller, 'create']
}),
('/os-floating-ips/{id}', {
'GET': [floating_ips_controller, 'show'],
'DELETE': [floating_ips_controller, 'delete']
}),
('/os-keypairs', {
'GET': [keypairs_controller, 'index'],
'POST': [keypairs_controller, 'create']
-1
View File
@@ -87,7 +87,6 @@ nova.api.v21.extensions =
fixed_ips = nova.api.openstack.compute.fixed_ips:FixedIps
floating_ip_dns = nova.api.openstack.compute.floating_ip_dns:FloatingIpDns
floating_ip_pools = nova.api.openstack.compute.floating_ip_pools:FloatingIpPools
floating_ips = nova.api.openstack.compute.floating_ips:FloatingIps
floating_ips_bulk = nova.api.openstack.compute.floating_ips_bulk:FloatingIpsBulk
fping = nova.api.openstack.compute.fping:Fping
hosts = nova.api.openstack.compute.hosts:Hosts