Merge "Cleanup v2.1 controller inheritance"

This commit is contained in:
Jenkins 2014-11-23 04:13:02 +00:00 committed by Gerrit Code Review
commit 19eaec8237
23 changed files with 37 additions and 24 deletions

View File

@ -27,7 +27,7 @@ ALIAS = "os-agents"
authorize = extensions.extension_authorizer('compute', 'v3:' + ALIAS) 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 """The agent is talking about guest agent.The host can use this for
things like accessing files on the disk, configuring networking, things like accessing files on the disk, configuring networking,
or running other applications/scripts in the guest while it is or running other applications/scripts in the guest while it is

View File

@ -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.""" """The interface attachment API controller for the OpenStack API."""
def __init__(self): def __init__(self):

View File

@ -25,6 +25,7 @@ from webob import exc
from nova.api.openstack import common from nova.api.openstack import common
from nova.api.openstack.compute.schemas.v3 import cells from nova.api.openstack.compute.schemas.v3 import cells
from nova.api.openstack import extensions from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova.api import validation from nova.api import validation
from nova.cells import rpcapi as cells_rpcapi from nova.cells import rpcapi as cells_rpcapi
from nova.compute import api as compute from nova.compute import api as compute
@ -91,7 +92,7 @@ def _scrub_cell(cell, detail=False):
return cell_info return cell_info
class CellsController(object): class CellsController(wsgi.Controller):
"""Controller for Cell resources.""" """Controller for Cell resources."""
def __init__(self): def __init__(self):

View File

@ -15,6 +15,7 @@
import webob.exc import webob.exc
from nova.api.openstack import extensions from nova.api.openstack import extensions
from nova.api.openstack import wsgi
import nova.cert.rpcapi import nova.cert.rpcapi
from nova import exception from nova import exception
from nova.i18n import _ 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.""" """The x509 Certificates API controller for the OpenStack API."""
def __init__(self): def __init__(self):

View File

@ -41,7 +41,7 @@ def _translate_detail_keys(cons):
return dict(console=info) return dict(console=info)
class ConsolesController(object): class ConsolesController(wsgi.Controller):
"""The Consoles controller for the OpenStack API.""" """The Consoles controller for the OpenStack API."""
def __init__(self): def __init__(self):

View File

@ -15,13 +15,14 @@
import webob.exc import webob.exc
from nova.api.openstack import extensions from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova.openstack.common import log as logging from nova.openstack.common import log as logging
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
class ExtensionInfoController(object): class ExtensionInfoController(wsgi.Controller):
def __init__(self, extension_info): def __init__(self, extension_info):
self.extension_info = extension_info self.extension_info = extension_info

View File

@ -40,7 +40,7 @@ def _marshall_flavor_access(flavor):
return {'flavor_access': rval} return {'flavor_access': rval}
class FlavorAccessController(object): class FlavorAccessController(wsgi.Controller):
"""The flavor access API controller for the OpenStack API.""" """The flavor access API controller for the OpenStack API."""
def __init__(self): def __init__(self):

View File

@ -18,6 +18,7 @@ import webob
from nova.api.openstack.compute.schemas.v3 import flavors_extraspecs from nova.api.openstack.compute.schemas.v3 import flavors_extraspecs
from nova.api.openstack import extensions from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova.api import validation from nova.api import validation
from nova import exception from nova import exception
from nova.i18n import _ from nova.i18n import _
@ -28,7 +29,7 @@ ALIAS = 'flavor-extra-specs'
authorize = extensions.extension_authorizer('compute', 'v3:' + ALIAS) authorize = extensions.extension_authorizer('compute', 'v3:' + ALIAS)
class FlavorExtraSpecsController(object): class FlavorExtraSpecsController(wsgi.Controller):
"""The flavor extra specs API controller for the OpenStack API.""" """The flavor extra specs API controller for the OpenStack API."""
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):

View File

@ -79,7 +79,7 @@ def _create_domain_entry(domain, scope=None, project=None, av_zone=None):
'availability_zone': av_zone} 'availability_zone': av_zone}
class FloatingIPDNSDomainController(object): class FloatingIPDNSDomainController(wsgi.Controller):
"""DNS domain controller for OpenStack API.""" """DNS domain controller for OpenStack API."""
def __init__(self): def __init__(self):
@ -160,7 +160,7 @@ class FloatingIPDNSDomainController(object):
raise webob.exc.HTTPNotFound(explanation=e.format_message()) raise webob.exc.HTTPNotFound(explanation=e.format_message())
class FloatingIPDNSEntryController(object): class FloatingIPDNSEntryController(wsgi.Controller):
"""DNS Entry controller for OpenStack API.""" """DNS Entry controller for OpenStack API."""
def __init__(self): def __init__(self):

View File

@ -13,6 +13,7 @@
# under the License. # under the License.
from nova.api.openstack import extensions from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova import network 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.""" """The Floating IP Pool API controller for the OpenStack API."""
def __init__(self): def __init__(self):

View File

@ -19,6 +19,7 @@ import webob.exc
from nova.api.openstack.compute.schemas.v3 import floating_ips_bulk from nova.api.openstack.compute.schemas.v3 import floating_ips_bulk
from nova.api.openstack import extensions from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova.api import validation from nova.api import validation
from nova import exception from nova import exception
from nova.i18n import _ from nova.i18n import _
@ -33,7 +34,7 @@ ALIAS = 'os-floating-ips-bulk'
authorize = extensions.extension_authorizer('compute', 'v3:' + ALIAS) authorize = extensions.extension_authorizer('compute', 'v3:' + ALIAS)
class FloatingIPBulkController(object): class FloatingIPBulkController(wsgi.Controller):
@extensions.expected_errors(404) @extensions.expected_errors(404)
def index(self, req): def index(self, req):

View File

@ -22,6 +22,7 @@ from webob import exc
from nova.api.openstack import common from nova.api.openstack import common
from nova.api.openstack import extensions from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova import compute from nova import compute
from nova import exception from nova import exception
from nova.i18n import _ from nova.i18n import _
@ -37,7 +38,7 @@ CONF = cfg.CONF
CONF.import_opt('fping_path', 'nova.api.openstack.compute.contrib.fping') CONF.import_opt('fping_path', 'nova.api.openstack.compute.contrib.fping')
class FpingController(object): class FpingController(wsgi.Controller):
def __init__(self, network_api=None): def __init__(self, network_api=None):
self.compute_api = compute.API() self.compute_api = compute.API()

View File

@ -18,6 +18,7 @@
import webob.exc import webob.exc
from nova.api.openstack import extensions from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova import compute from nova import compute
from nova import exception from nova import exception
from nova.i18n import _ from nova.i18n import _
@ -28,7 +29,7 @@ ALIAS = "os-hypervisors"
authorize = extensions.extension_authorizer('compute', 'v3:' + ALIAS) authorize = extensions.extension_authorizer('compute', 'v3:' + ALIAS)
class HypervisorsController(object): class HypervisorsController(wsgi.Controller):
"""The Hypervisors API controller for the OpenStack API.""" """The Hypervisors API controller for the OpenStack API."""
def __init__(self): def __init__(self):

View File

@ -25,7 +25,7 @@ import nova.image
ALIAS = 'image-metadata' ALIAS = 'image-metadata'
class ImageMetadataController(object): class ImageMetadataController(wsgi.Controller):
"""The image metadata API controller for the OpenStack API.""" """The image metadata API controller for the OpenStack API."""
def __init__(self): def __init__(self):

View File

@ -32,7 +32,7 @@ authorize = extensions.extension_authorizer('compute', 'v3:' + ALIAS)
soft_authorize = extensions.soft_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.""" """Keypair API controller for the OpenStack API."""
def __init__(self): def __init__(self):

View File

@ -16,6 +16,7 @@
from nova.api.openstack.compute.views import limits as limits_views from nova.api.openstack.compute.views import limits as limits_views
from nova.api.openstack import extensions from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova import quota from nova import quota
@ -23,7 +24,7 @@ QUOTAS = quota.QUOTAS
ALIAS = 'limits' ALIAS = 'limits'
class LimitsController(object): class LimitsController(wsgi.Controller):
"""Controller for accessing limits in the OpenStack API.""" """Controller for accessing limits in the OpenStack API."""
@extensions.expected_errors(()) @extensions.expected_errors(())

View File

@ -11,6 +11,7 @@
# under the License. # under the License.
from nova.api.openstack import extensions from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova import compute from nova import compute
from nova.objects import base as obj_base from nova.objects import base as obj_base
@ -36,7 +37,7 @@ def output(migrations_obj):
return objects return objects
class MigrationsController(object): class MigrationsController(wsgi.Controller):
"""Controller for accessing migrations in OpenStack API.""" """Controller for accessing migrations in OpenStack API."""
def __init__(self): def __init__(self):
self.compute_api = compute.API() self.compute_api = compute.API()

View File

@ -80,7 +80,7 @@ class PciHypervisorController(wsgi.Controller):
self._extend_hypervisor(hypervisor, compute_node) self._extend_hypervisor(hypervisor, compute_node)
class PciController(object): class PciController(wsgi.Controller):
def __init__(self): def __init__(self):
self.host_api = compute.HostAPI() self.host_api = compute.HostAPI()

View File

@ -17,6 +17,7 @@ import webob.exc
from nova.api.openstack import common from nova.api.openstack import common
from nova.api.openstack import extensions from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova import compute from nova import compute
from nova import exception from nova import exception
from nova.i18n import _ from nova.i18n import _
@ -26,7 +27,7 @@ ALIAS = "os-server-diagnostics"
authorize = extensions.extension_authorizer('compute', 'v3:' + ALIAS) authorize = extensions.extension_authorizer('compute', 'v3:' + ALIAS)
class ServerDiagnosticsController(object): class ServerDiagnosticsController(wsgi.Controller):
def __init__(self): def __init__(self):
self.compute_api = compute.API() self.compute_api = compute.API()

View File

@ -26,7 +26,7 @@ ALIAS = 'os-server-password'
authorize = extensions.extension_authorizer('compute', 'v3:' + ALIAS) authorize = extensions.extension_authorizer('compute', 'v3:' + ALIAS)
class ServerPasswordController(object): class ServerPasswordController(wsgi.Controller):
"""The Server Password API controller for the OpenStack API.""" """The Server Password API controller for the OpenStack API."""
def __init__(self): def __init__(self):
self.compute_api = compute.API() self.compute_api = compute.API()

View File

@ -22,6 +22,7 @@ import six.moves.urllib.parse as urlparse
from webob import exc from webob import exc
from nova.api.openstack import extensions from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova import exception from nova import exception
from nova.i18n import _ from nova.i18n import _
from nova import objects from nova import objects
@ -41,7 +42,7 @@ def parse_strtime(dstr, fmt):
raise exception.InvalidStrTime(reason=six.text_type(e)) raise exception.InvalidStrTime(reason=six.text_type(e))
class SimpleTenantUsageController(object): class SimpleTenantUsageController(wsgi.Controller):
def _hours_for(self, instance, period_start, period_stop): def _hours_for(self, instance, period_start, period_stop):
launched_at = instance.launched_at launched_at = instance.launched_at
terminated_at = instance.terminated_at terminated_at = instance.terminated_at

View File

@ -55,7 +55,7 @@ def network_dict(network):
"label": network.get("label")} "label": network.get("label")}
class TenantNetworkController(object): class TenantNetworkController(wsgi.Controller):
def __init__(self, network_api=None): def __init__(self, network_api=None):
self.network_api = nova.network.API() self.network_api = nova.network.API()
self._default_networks = [] self._default_networks = []

View File

@ -18,12 +18,13 @@ import webob.exc
from nova.api.openstack.compute import versions from nova.api.openstack.compute import versions
from nova.api.openstack.compute.views import versions as views_versions from nova.api.openstack.compute.views import versions as views_versions
from nova.api.openstack import extensions from nova.api.openstack import extensions
from nova.api.openstack import wsgi
ALIAS = "versions" ALIAS = "versions"
class VersionsController(object): class VersionsController(wsgi.Controller):
@extensions.expected_errors(404) @extensions.expected_errors(404)
def show(self, req, id='v2.1'): def show(self, req, id='v2.1'):
builder = views_versions.get_view_builder(req) builder = views_versions.get_view_builder(req)