Use plain routes list for os-baremetal-nodes endpoint instead of stevedore
This patch adds os-baremetal-nodes 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: I2df8f897cf2d53d01e5e9156efbcddd7aa988473
This commit is contained in:
parent
7f484134fb
commit
24fadbec46
|
@ -31,8 +31,6 @@ from nova.policies import baremetal_nodes as bn_policies
|
|||
ironic_client = importutils.try_import('ironicclient.client')
|
||||
ironic_exc = importutils.try_import('ironicclient.exc')
|
||||
|
||||
ALIAS = "os-baremetal-nodes"
|
||||
|
||||
node_fields = ['id', 'cpus', 'local_gb', 'memory_mb', 'pm_address',
|
||||
'pm_user', 'service_host', 'terminal_port', 'instance_uuid']
|
||||
|
||||
|
@ -154,23 +152,3 @@ class BareMetalNodeController(wsgi.Controller):
|
|||
@extensions.expected_errors(400)
|
||||
def _remove_interface(self, req, id, body):
|
||||
_no_ironic_proxy("port-delete")
|
||||
|
||||
|
||||
class BareMetalNodes(extensions.V21APIExtensionBase):
|
||||
"""Admin-only bare-metal node administration."""
|
||||
|
||||
name = "BareMetalNodes"
|
||||
alias = ALIAS
|
||||
version = 1
|
||||
|
||||
def get_resources(self):
|
||||
resource = [extensions.ResourceExtension(ALIAS,
|
||||
BareMetalNodeController(),
|
||||
member_actions={"action": "POST"})]
|
||||
return resource
|
||||
|
||||
def get_controller_extensions(self):
|
||||
"""It's an abstract function V21APIExtensionBase and the extension
|
||||
will not be loaded without it.
|
||||
"""
|
||||
return []
|
||||
|
|
|
@ -24,6 +24,7 @@ from nova.api.openstack.compute import aggregates
|
|||
from nova.api.openstack.compute import assisted_volume_snapshots
|
||||
from nova.api.openstack.compute import attach_interfaces
|
||||
from nova.api.openstack.compute import availability_zone
|
||||
from nova.api.openstack.compute import baremetal_nodes
|
||||
from nova.api.openstack.compute import cells
|
||||
from nova.api.openstack.compute import certificates
|
||||
from nova.api.openstack.compute import cloudpipe
|
||||
|
@ -130,6 +131,10 @@ availability_zone_controller = functools.partial(
|
|||
_create_controller, availability_zone.AvailabilityZoneController, [], [])
|
||||
|
||||
|
||||
baremetal_nodes_controller = functools.partial(
|
||||
_create_controller, baremetal_nodes.BareMetalNodeController, [], [])
|
||||
|
||||
|
||||
cells_controller = functools.partial(
|
||||
_create_controller, cells.CellsController, [], [])
|
||||
|
||||
|
@ -459,6 +464,17 @@ ROUTE_LIST = (
|
|||
('/os-availability-zone/detail', {
|
||||
'GET': [availability_zone_controller, 'detail'],
|
||||
}),
|
||||
('/os-baremetal-nodes', {
|
||||
'GET': [baremetal_nodes_controller, 'index'],
|
||||
'POST': [baremetal_nodes_controller, 'create']
|
||||
}),
|
||||
('/os-baremetal-nodes/{id}', {
|
||||
'GET': [baremetal_nodes_controller, 'show'],
|
||||
'DELETE': [baremetal_nodes_controller, 'delete']
|
||||
}),
|
||||
('/os-baremetal-nodes/{id}/action', {
|
||||
'POST': [baremetal_nodes_controller, 'action']
|
||||
}),
|
||||
('/os-cells', {
|
||||
'POST': [cells_controller, 'create'],
|
||||
'GET': [cells_controller, 'index'],
|
||||
|
|
|
@ -72,7 +72,6 @@ wsgi_scripts =
|
|||
nova-metadata-wsgi = nova.api.metadata.wsgi:init_application
|
||||
|
||||
nova.api.v21.extensions =
|
||||
baremetal_nodes = nova.api.openstack.compute.baremetal_nodes:BareMetalNodes
|
||||
extension_info = nova.api.openstack.compute.extension_info:ExtensionInfo
|
||||
versions = nova.api.openstack.compute.versionsV21:Versions
|
||||
volumes = nova.api.openstack.compute.volumes:Volumes
|
||||
|
|
Loading…
Reference in New Issue