Cleanup v2.1 controller inheritance
For microversions support to work all the API controllers must inherit from wsgi.Controller rather than object. Currently most do inherit from wsgi.Controller but some don't. This patch ensures that all do so. Partially implements blueprint api-microversions Change-Id: Ic7351298ae96aa7bb509eb3784e672d5feea262a
This commit is contained in:
parent
c1ef7efa66
commit
f15d74b017
|
@ -27,7 +27,7 @@ ALIAS = "os-agents"
|
|||
authorize = extensions.extension_authorizer('compute', 'v3:' + ALIAS)
|
||||
|
||||
|
||||
class AgentController(object):
|
||||
class AgentController(wsgi.Controller):
|
||||
"""The agent is talking about guest agent.The host can use this for
|
||||
things like accessing files on the disk, configuring networking,
|
||||
or running other applications/scripts in the guest while it is
|
||||
|
|
|
@ -45,7 +45,7 @@ def _translate_interface_attachment_view(port_info):
|
|||
}
|
||||
|
||||
|
||||
class InterfaceAttachmentController(object):
|
||||
class InterfaceAttachmentController(wsgi.Controller):
|
||||
"""The interface attachment API controller for the OpenStack API."""
|
||||
|
||||
def __init__(self):
|
||||
|
|
|
@ -25,6 +25,7 @@ from webob import exc
|
|||
from nova.api.openstack import common
|
||||
from nova.api.openstack.compute.schemas.v3 import cells
|
||||
from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova.api import validation
|
||||
from nova.cells import rpcapi as cells_rpcapi
|
||||
from nova.compute import api as compute
|
||||
|
@ -91,7 +92,7 @@ def _scrub_cell(cell, detail=False):
|
|||
return cell_info
|
||||
|
||||
|
||||
class CellsController(object):
|
||||
class CellsController(wsgi.Controller):
|
||||
"""Controller for Cell resources."""
|
||||
|
||||
def __init__(self):
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
import webob.exc
|
||||
|
||||
from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
import nova.cert.rpcapi
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
|
@ -31,7 +32,7 @@ def _translate_certificate_view(certificate, private_key=None):
|
|||
}
|
||||
|
||||
|
||||
class CertificatesController(object):
|
||||
class CertificatesController(wsgi.Controller):
|
||||
"""The x509 Certificates API controller for the OpenStack API."""
|
||||
|
||||
def __init__(self):
|
||||
|
|
|
@ -41,7 +41,7 @@ def _translate_detail_keys(cons):
|
|||
return dict(console=info)
|
||||
|
||||
|
||||
class ConsolesController(object):
|
||||
class ConsolesController(wsgi.Controller):
|
||||
"""The Consoles controller for the OpenStack API."""
|
||||
|
||||
def __init__(self):
|
||||
|
|
|
@ -15,13 +15,14 @@
|
|||
import webob.exc
|
||||
|
||||
from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova.openstack.common import log as logging
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class ExtensionInfoController(object):
|
||||
class ExtensionInfoController(wsgi.Controller):
|
||||
|
||||
def __init__(self, extension_info):
|
||||
self.extension_info = extension_info
|
||||
|
|
|
@ -40,7 +40,7 @@ def _marshall_flavor_access(flavor):
|
|||
return {'flavor_access': rval}
|
||||
|
||||
|
||||
class FlavorAccessController(object):
|
||||
class FlavorAccessController(wsgi.Controller):
|
||||
"""The flavor access API controller for the OpenStack API."""
|
||||
|
||||
def __init__(self):
|
||||
|
|
|
@ -18,6 +18,7 @@ import webob
|
|||
|
||||
from nova.api.openstack.compute.schemas.v3 import flavors_extraspecs
|
||||
from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova.api import validation
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
|
@ -28,7 +29,7 @@ ALIAS = 'flavor-extra-specs'
|
|||
authorize = extensions.extension_authorizer('compute', 'v3:' + ALIAS)
|
||||
|
||||
|
||||
class FlavorExtraSpecsController(object):
|
||||
class FlavorExtraSpecsController(wsgi.Controller):
|
||||
"""The flavor extra specs API controller for the OpenStack API."""
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
|
|
@ -79,7 +79,7 @@ def _create_domain_entry(domain, scope=None, project=None, av_zone=None):
|
|||
'availability_zone': av_zone}
|
||||
|
||||
|
||||
class FloatingIPDNSDomainController(object):
|
||||
class FloatingIPDNSDomainController(wsgi.Controller):
|
||||
"""DNS domain controller for OpenStack API."""
|
||||
|
||||
def __init__(self):
|
||||
|
@ -160,7 +160,7 @@ class FloatingIPDNSDomainController(object):
|
|||
raise webob.exc.HTTPNotFound(explanation=e.format_message())
|
||||
|
||||
|
||||
class FloatingIPDNSEntryController(object):
|
||||
class FloatingIPDNSEntryController(wsgi.Controller):
|
||||
"""DNS Entry controller for OpenStack API."""
|
||||
|
||||
def __init__(self):
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
# under the License.
|
||||
|
||||
from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova import network
|
||||
|
||||
|
||||
|
@ -33,7 +34,7 @@ def _translate_floating_ip_pools_view(pools):
|
|||
}
|
||||
|
||||
|
||||
class FloatingIPPoolsController(object):
|
||||
class FloatingIPPoolsController(wsgi.Controller):
|
||||
"""The Floating IP Pool API controller for the OpenStack API."""
|
||||
|
||||
def __init__(self):
|
||||
|
|
|
@ -19,6 +19,7 @@ import webob.exc
|
|||
|
||||
from nova.api.openstack.compute.schemas.v3 import floating_ips_bulk
|
||||
from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova.api import validation
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
|
@ -33,7 +34,7 @@ ALIAS = 'os-floating-ips-bulk'
|
|||
authorize = extensions.extension_authorizer('compute', 'v3:' + ALIAS)
|
||||
|
||||
|
||||
class FloatingIPBulkController(object):
|
||||
class FloatingIPBulkController(wsgi.Controller):
|
||||
|
||||
@extensions.expected_errors(404)
|
||||
def index(self, req):
|
||||
|
|
|
@ -22,6 +22,7 @@ from webob import exc
|
|||
|
||||
from nova.api.openstack import common
|
||||
from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
|
@ -37,7 +38,7 @@ CONF = cfg.CONF
|
|||
CONF.import_opt('fping_path', 'nova.api.openstack.compute.contrib.fping')
|
||||
|
||||
|
||||
class FpingController(object):
|
||||
class FpingController(wsgi.Controller):
|
||||
|
||||
def __init__(self, network_api=None):
|
||||
self.compute_api = compute.API()
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
import webob.exc
|
||||
|
||||
from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
|
@ -28,7 +29,7 @@ ALIAS = "os-hypervisors"
|
|||
authorize = extensions.extension_authorizer('compute', 'v3:' + ALIAS)
|
||||
|
||||
|
||||
class HypervisorsController(object):
|
||||
class HypervisorsController(wsgi.Controller):
|
||||
"""The Hypervisors API controller for the OpenStack API."""
|
||||
|
||||
def __init__(self):
|
||||
|
|
|
@ -25,7 +25,7 @@ import nova.image
|
|||
ALIAS = 'image-metadata'
|
||||
|
||||
|
||||
class ImageMetadataController(object):
|
||||
class ImageMetadataController(wsgi.Controller):
|
||||
"""The image metadata API controller for the OpenStack API."""
|
||||
|
||||
def __init__(self):
|
||||
|
|
|
@ -32,7 +32,7 @@ authorize = extensions.extension_authorizer('compute', 'v3:' + ALIAS)
|
|||
soft_authorize = extensions.soft_extension_authorizer('compute', 'v3:' + ALIAS)
|
||||
|
||||
|
||||
class KeypairController(object):
|
||||
class KeypairController(wsgi.Controller):
|
||||
|
||||
"""Keypair API controller for the OpenStack API."""
|
||||
def __init__(self):
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
from nova.api.openstack.compute.views import limits as limits_views
|
||||
from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova import quota
|
||||
|
||||
|
||||
|
@ -23,7 +24,7 @@ QUOTAS = quota.QUOTAS
|
|||
ALIAS = 'limits'
|
||||
|
||||
|
||||
class LimitsController(object):
|
||||
class LimitsController(wsgi.Controller):
|
||||
"""Controller for accessing limits in the OpenStack API."""
|
||||
|
||||
@extensions.expected_errors(())
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
# under the License.
|
||||
|
||||
from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova import compute
|
||||
from nova.objects import base as obj_base
|
||||
|
||||
|
@ -36,7 +37,7 @@ def output(migrations_obj):
|
|||
return objects
|
||||
|
||||
|
||||
class MigrationsController(object):
|
||||
class MigrationsController(wsgi.Controller):
|
||||
"""Controller for accessing migrations in OpenStack API."""
|
||||
def __init__(self):
|
||||
self.compute_api = compute.API()
|
||||
|
|
|
@ -80,7 +80,7 @@ class PciHypervisorController(wsgi.Controller):
|
|||
self._extend_hypervisor(hypervisor, compute_node)
|
||||
|
||||
|
||||
class PciController(object):
|
||||
class PciController(wsgi.Controller):
|
||||
|
||||
def __init__(self):
|
||||
self.host_api = compute.HostAPI()
|
||||
|
|
|
@ -17,6 +17,7 @@ import webob.exc
|
|||
|
||||
from nova.api.openstack import common
|
||||
from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova import compute
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
|
@ -26,7 +27,7 @@ ALIAS = "os-server-diagnostics"
|
|||
authorize = extensions.extension_authorizer('compute', 'v3:' + ALIAS)
|
||||
|
||||
|
||||
class ServerDiagnosticsController(object):
|
||||
class ServerDiagnosticsController(wsgi.Controller):
|
||||
def __init__(self):
|
||||
self.compute_api = compute.API()
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ ALIAS = 'os-server-password'
|
|||
authorize = extensions.extension_authorizer('compute', 'v3:' + ALIAS)
|
||||
|
||||
|
||||
class ServerPasswordController(object):
|
||||
class ServerPasswordController(wsgi.Controller):
|
||||
"""The Server Password API controller for the OpenStack API."""
|
||||
def __init__(self):
|
||||
self.compute_api = compute.API()
|
||||
|
|
|
@ -22,6 +22,7 @@ import six.moves.urllib.parse as urlparse
|
|||
from webob import exc
|
||||
|
||||
from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova import objects
|
||||
|
@ -41,7 +42,7 @@ def parse_strtime(dstr, fmt):
|
|||
raise exception.InvalidStrTime(reason=six.text_type(e))
|
||||
|
||||
|
||||
class SimpleTenantUsageController(object):
|
||||
class SimpleTenantUsageController(wsgi.Controller):
|
||||
def _hours_for(self, instance, period_start, period_stop):
|
||||
launched_at = instance.launched_at
|
||||
terminated_at = instance.terminated_at
|
||||
|
|
|
@ -55,7 +55,7 @@ def network_dict(network):
|
|||
"label": network.get("label")}
|
||||
|
||||
|
||||
class TenantNetworkController(object):
|
||||
class TenantNetworkController(wsgi.Controller):
|
||||
def __init__(self, network_api=None):
|
||||
self.network_api = nova.network.API()
|
||||
self._default_networks = []
|
||||
|
|
|
@ -18,12 +18,13 @@ import webob.exc
|
|||
from nova.api.openstack.compute import versions
|
||||
from nova.api.openstack.compute.views import versions as views_versions
|
||||
from nova.api.openstack import extensions
|
||||
from nova.api.openstack import wsgi
|
||||
|
||||
|
||||
ALIAS = "versions"
|
||||
|
||||
|
||||
class VersionsController(object):
|
||||
class VersionsController(wsgi.Controller):
|
||||
@extensions.expected_errors(404)
|
||||
def show(self, req, id='v2.1'):
|
||||
builder = views_versions.get_view_builder(req)
|
||||
|
|
Loading…
Reference in New Issue