Skip to content

Commit ea7293c

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Ensure controllers all call super"
2 parents c27809d + db1789e commit ea7293c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+75
-65
lines changed

nova/api/openstack/compute/admin_actions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030

3131

3232
class AdminActionsController(wsgi.Controller):
33-
def __init__(self, *args, **kwargs):
34-
super(AdminActionsController, self).__init__(*args, **kwargs)
33+
def __init__(self):
34+
super(AdminActionsController, self).__init__()
3535
self.compute_api = compute.API()
3636

3737
@wsgi.response(202)

nova/api/openstack/compute/admin_password.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626

2727
class AdminPasswordController(wsgi.Controller):
2828

29-
def __init__(self, *args, **kwargs):
30-
super(AdminPasswordController, self).__init__(*args, **kwargs)
29+
def __init__(self):
30+
super(AdminPasswordController, self).__init__()
3131
self.compute_api = compute.API()
3232

3333
# TODO(eliqiao): Here should be 204(No content) instead of 202 by v2.1+

nova/api/openstack/compute/aggregates.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from nova.api.openstack.compute.schemas import aggregates
2525
from nova.api.openstack import wsgi
2626
from nova.api import validation
27-
from nova.compute import api as compute_api
27+
from nova.compute import api as compute
2828
from nova import exception
2929
from nova.i18n import _
3030
from nova.policies import aggregates as aggr_policies
@@ -37,7 +37,8 @@ def _get_context(req):
3737
class AggregateController(wsgi.Controller):
3838
"""The Host Aggregates API controller for the OpenStack API."""
3939
def __init__(self):
40-
self.api = compute_api.AggregateAPI()
40+
super(AggregateController, self).__init__()
41+
self.api = compute.AggregateAPI()
4142

4243
@wsgi.expected_errors(())
4344
def index(self, req):

nova/api/openstack/compute/assisted_volume_snapshots.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ class AssistedVolumeSnapshotsController(wsgi.Controller):
3232
"""The Assisted volume snapshots API controller for the OpenStack API."""
3333

3434
def __init__(self):
35-
self.compute_api = compute.API()
3635
super(AssistedVolumeSnapshotsController, self).__init__()
36+
self.compute_api = compute.API()
3737

3838
@wsgi.expected_errors(400)
3939
@validation.schema(assisted_volume_snapshots.snapshots_create)

nova/api/openstack/compute/attach_interfaces.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ class InterfaceAttachmentController(wsgi.Controller):
5959
"""The interface attachment API controller for the OpenStack API."""
6060

6161
def __init__(self):
62+
super(InterfaceAttachmentController, self).__init__()
6263
self.compute_api = compute.API()
6364
self.network_api = network.API()
64-
super(InterfaceAttachmentController, self).__init__()
6565

6666
@wsgi.expected_errors((404, 501))
6767
def index(self, req, server_id):

nova/api/openstack/compute/console_auth_tokens.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727

2828

2929
class ConsoleAuthTokensController(wsgi.Controller):
30-
def __init__(self, *args, **kwargs):
30+
def __init__(self):
31+
super(ConsoleAuthTokensController, self).__init__()
3132
self._consoleauth_rpcapi = consoleauth_rpcapi.ConsoleAuthAPI()
32-
super(ConsoleAuthTokensController, self).__init__(*args, **kwargs)
3333

3434
def _show(self, req, id, rdp_only):
3535
"""Checks a console auth token and returns the related connect info."""

nova/api/openstack/compute/console_output.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828

2929

3030
class ConsoleOutputController(wsgi.Controller):
31-
def __init__(self, *args, **kwargs):
32-
super(ConsoleOutputController, self).__init__(*args, **kwargs)
31+
def __init__(self):
32+
super(ConsoleOutputController, self).__init__()
3333
self.compute_api = compute.API()
3434

3535
@wsgi.expected_errors((404, 409, 501))

nova/api/openstack/compute/consoles.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class ConsolesController(wsgi.Controller):
4545
"""The Consoles controller for the OpenStack API."""
4646

4747
def __init__(self):
48+
super(ConsolesController, self).__init__()
4849
self.console_api = console_api.API()
4950

5051
@wsgi.expected_errors(())

nova/api/openstack/compute/create_backup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626

2727

2828
class CreateBackupController(wsgi.Controller):
29-
def __init__(self, *args, **kwargs):
30-
super(CreateBackupController, self).__init__(*args, **kwargs)
29+
def __init__(self):
30+
super(CreateBackupController, self).__init__()
3131
self.compute_api = compute.API()
3232

3333
@wsgi.response(202)

nova/api/openstack/compute/deferred_delete.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626

2727
class DeferredDeleteController(wsgi.Controller):
28-
def __init__(self, *args, **kwargs):
29-
super(DeferredDeleteController, self).__init__(*args, **kwargs)
28+
def __init__(self):
29+
super(DeferredDeleteController, self).__init__()
3030
self.compute_api = compute.API()
3131

3232
@wsgi.response(202)

nova/api/openstack/compute/evacuate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333

3434

3535
class EvacuateController(wsgi.Controller):
36-
def __init__(self, *args, **kwargs):
37-
super(EvacuateController, self).__init__(*args, **kwargs)
36+
def __init__(self):
37+
super(EvacuateController, self).__init__()
3838
self.compute_api = compute.API()
3939
self.host_api = compute.HostAPI()
4040
self.network_api = network.API()

nova/api/openstack/compute/flavor_manage.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ class FlavorManageController(wsgi.Controller):
2828
"""The Flavor Lifecycle API controller for the OpenStack API."""
2929
_view_builder_class = flavors_view.ViewBuilder
3030

31-
def __init__(self):
32-
super(FlavorManageController, self).__init__()
33-
3431
# NOTE(oomichi): Return 202 for backwards compatibility but should be
3532
# 204 as this operation complete the deletion of aggregate resource and
3633
# return no response body.

nova/api/openstack/compute/floating_ip_pools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ class FloatingIPPoolsController(wsgi.Controller):
3636
"""The Floating IP Pool API controller for the OpenStack API."""
3737

3838
def __init__(self):
39-
self.network_api = network.API()
4039
super(FloatingIPPoolsController, self).__init__()
40+
self.network_api = network.API()
4141

4242
@wsgi.Controller.api_version("2.1", MAX_PROXY_API_SUPPORT_VERSION)
4343
@wsgi.expected_errors(())

nova/api/openstack/compute/floating_ips.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ class FloatingIPController(wsgi.Controller):
106106
"""The Floating IPs API controller for the OpenStack API."""
107107

108108
def __init__(self):
109+
super(FloatingIPController, self).__init__()
109110
self.compute_api = compute.API()
110111
self.network_api = network.API()
111-
super(FloatingIPController, self).__init__()
112112

113113
@wsgi.Controller.api_version("2.1", MAX_PROXY_API_SUPPORT_VERSION)
114114
@wsgi.expected_errors((400, 404))
@@ -204,8 +204,8 @@ def delete(self, req, id):
204204
class FloatingIPActionController(wsgi.Controller):
205205
"""This API is deprecated from the Microversion '2.44'."""
206206

207-
def __init__(self, *args, **kwargs):
208-
super(FloatingIPActionController, self).__init__(*args, **kwargs)
207+
def __init__(self):
208+
super(FloatingIPActionController, self).__init__()
209209
self.compute_api = compute.API()
210210
self.network_api = network.API()
211211

nova/api/openstack/compute/hosts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
class HostController(wsgi.Controller):
3636
"""The Hosts API controller for the OpenStack API."""
3737
def __init__(self):
38-
self.api = compute.HostAPI()
3938
super(HostController, self).__init__()
39+
self.api = compute.HostAPI()
4040

4141
@wsgi.Controller.api_version("2.1", "2.42")
4242
@validation.query_schema(hosts.index_query)

nova/api/openstack/compute/hypervisors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ class HypervisorsController(wsgi.Controller):
4545
_view_builder_class = hyper_view.ViewBuilder
4646

4747
def __init__(self):
48+
super(HypervisorsController, self).__init__()
4849
self.host_api = compute.HostAPI()
4950
self.servicegroup_api = servicegroup.API()
50-
super(HypervisorsController, self).__init__()
5151

5252
def _view_hypervisor(self, hypervisor, service, detail, req, servers=None,
5353
**kwargs):

nova/api/openstack/compute/image_metadata.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class ImageMetadataController(wsgi.Controller):
3131
"""The image metadata API controller for the OpenStack API."""
3232

3333
def __init__(self):
34+
super(ImageMetadataController, self).__init__()
3435
self.image_api = nova.image.API()
3536

3637
def _get_image(self, context, image_id):

nova/api/openstack/compute/images.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ class ImagesController(wsgi.Controller):
4242

4343
_view_builder_class = views_images.ViewBuilder
4444

45-
def __init__(self, **kwargs):
46-
super(ImagesController, self).__init__(**kwargs)
45+
def __init__(self):
46+
super(ImagesController, self).__init__()
4747
self._image_api = nova.image.API()
4848

4949
def _get_filters(self, req):

nova/api/openstack/compute/instance_usage_audit_log.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727

2828

2929
class InstanceUsageAuditLogController(wsgi.Controller):
30+
3031
def __init__(self):
32+
super(InstanceUsageAuditLogController, self).__init__()
3133
self.host_api = compute.HostAPI()
3234

3335
@wsgi.expected_errors(())

nova/api/openstack/compute/ips.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ class IPsController(wsgi.Controller):
3131
# microversion by using V2.1 view builder.
3232
_view_builder_class = views_addresses.ViewBuilder
3333

34-
def __init__(self, **kwargs):
35-
super(IPsController, self).__init__(**kwargs)
34+
def __init__(self):
35+
super(IPsController, self).__init__()
3636
self._compute_api = compute.API()
3737

3838
@wsgi.expected_errors(404)

nova/api/openstack/compute/keypairs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ class KeypairController(wsgi.Controller):
3838
_view_builder_class = keypairs_view.ViewBuilder
3939

4040
def __init__(self):
41-
self.api = compute_api.KeypairAPI()
4241
super(KeypairController, self).__init__()
42+
self.api = compute_api.KeypairAPI()
4343

4444
def _filter_keypair(self, keypair, **attrs):
4545
# TODO(claudiub): After v2 and v2.1 is no longer supported,

nova/api/openstack/compute/lock_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323

2424

2525
class LockServerController(wsgi.Controller):
26-
def __init__(self, *args, **kwargs):
27-
super(LockServerController, self).__init__(*args, **kwargs)
26+
def __init__(self):
27+
super(LockServerController, self).__init__()
2828
self.compute_api = compute.API()
2929

3030
@wsgi.response(202)

nova/api/openstack/compute/migrate_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333

3434

3535
class MigrateServerController(wsgi.Controller):
36-
def __init__(self, *args, **kwargs):
37-
super(MigrateServerController, self).__init__(*args, **kwargs)
36+
def __init__(self):
37+
super(MigrateServerController, self).__init__()
3838
self.compute_api = compute.API()
3939
self.network_api = network.API()
4040

nova/api/openstack/compute/multinic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
class MultinicController(wsgi.Controller):
3030
"""This API is deprecated from Microversion '2.44'."""
3131

32-
def __init__(self, *args, **kwargs):
33-
super(MultinicController, self).__init__(*args, **kwargs)
32+
def __init__(self):
33+
super(MultinicController, self).__init__()
3434
self.compute_api = compute.API()
3535

3636
@wsgi.Controller.api_version("2.1", "2.43")

nova/api/openstack/compute/networks.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ def network_dict(context, network):
7979
class NetworkController(wsgi.Controller):
8080

8181
def __init__(self, network_api=None):
82+
super(NetworkController, self).__init__()
83+
# TODO(stephenfin): 'network_api' is only being passed for use by tests
8284
self.network_api = network_api or network.API()
8385

8486
@wsgi.Controller.api_version("2.1", MAX_PROXY_API_SUPPORT_VERSION)

nova/api/openstack/compute/networks_associate.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ class NetworkAssociateActionController(wsgi.Controller):
2828
"""Network Association API Controller."""
2929

3030
def __init__(self, network_api=None):
31+
super(NetworkAssociateActionController, self).__init__()
32+
# TODO(stephenfin): 'network_api' is only being passed for use by tests
3133
self.network_api = network_api or network.API()
3234

3335
@wsgi.Controller.api_version("2.1", MAX_PROXY_API_SUPPORT_VERSION)

nova/api/openstack/compute/pause_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323

2424

2525
class PauseServerController(wsgi.Controller):
26-
def __init__(self, *args, **kwargs):
27-
super(PauseServerController, self).__init__(*args, **kwargs)
26+
def __init__(self):
27+
super(PauseServerController, self).__init__()
2828
self.compute_api = compute.API()
2929

3030
@wsgi.response(202)

nova/api/openstack/compute/quota_classes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ class QuotaClassSetsController(wsgi.Controller):
4747

4848
supported_quotas = []
4949

50-
def __init__(self, **kwargs):
50+
def __init__(self):
51+
super(QuotaClassSetsController, self).__init__()
5152
self.supported_quotas = QUOTAS.resources
5253

5354
def _format_quota_set(self, quota_class, quota_set, filtered_quotas=None,

nova/api/openstack/compute/remote_consoles.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@
2424

2525

2626
class RemoteConsolesController(wsgi.Controller):
27-
def __init__(self, *args, **kwargs):
27+
def __init__(self):
28+
super(RemoteConsolesController, self).__init__()
2829
self.compute_api = compute.API()
2930
self.handlers = {'vnc': self.compute_api.get_vnc_console,
3031
'spice': self.compute_api.get_spice_console,
3132
'rdp': self.compute_api.get_rdp_console,
3233
'serial': self.compute_api.get_serial_console,
3334
'mks': self.compute_api.get_mks_console}
34-
super(RemoteConsolesController, self).__init__(*args, **kwargs)
3535

3636
@wsgi.Controller.api_version("2.1", "2.5")
3737
@wsgi.expected_errors((400, 404, 409, 501))

nova/api/openstack/compute/rescue.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030

3131

3232
class RescueController(wsgi.Controller):
33-
def __init__(self, *args, **kwargs):
34-
super(RescueController, self).__init__(*args, **kwargs)
33+
def __init__(self):
34+
super(RescueController, self).__init__()
3535
self.compute_api = compute.API()
3636

3737
# TODO(cyeoh): Should be responding here with 202 Accept

nova/api/openstack/compute/security_group_default_rules.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class SecurityGroupDefaultRulesController(sg.SecurityGroupControllerBase,
2828
wsgi.Controller):
2929

3030
def __init__(self):
31+
super(SecurityGroupDefaultRulesController, self).__init__()
3132
self.security_group_api = (
3233
openstack_driver.get_openstack_security_group_driver())
3334

nova/api/openstack/compute/security_groups.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class SecurityGroupControllerBase(object):
4747
"""Base class for Security Group controllers."""
4848

4949
def __init__(self):
50+
super(SecurityGroupControllerBase, self).__init__()
5051
self.security_group_api = (
5152
openstack_driver.get_openstack_security_group_driver())
5253
self.compute_api = compute.API(
@@ -405,8 +406,8 @@ def index(self, req, server_id):
405406

406407

407408
class SecurityGroupActionController(wsgi.Controller):
408-
def __init__(self, *args, **kwargs):
409-
super(SecurityGroupActionController, self).__init__(*args, **kwargs)
409+
def __init__(self):
410+
super(SecurityGroupActionController, self).__init__()
410411
self.security_group_api = (
411412
openstack_driver.get_openstack_security_group_driver())
412413
self.compute_api = compute.API(

nova/api/openstack/compute/server_diagnostics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
class ServerDiagnosticsController(wsgi.Controller):
2828
_view_builder_class = server_diagnostics.ViewBuilder
2929

30-
def __init__(self, *args, **kwargs):
31-
super(ServerDiagnosticsController, self).__init__(*args, **kwargs)
30+
def __init__(self):
31+
super(ServerDiagnosticsController, self).__init__()
3232
self.compute_api = compute.API()
3333

3434
@wsgi.expected_errors((400, 404, 409, 501))

nova/api/openstack/compute/server_external_events.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
class ServerExternalEventsController(wsgi.Controller):
3232

3333
def __init__(self):
34-
self.compute_api = compute.API()
3534
super(ServerExternalEventsController, self).__init__()
35+
self.compute_api = compute.API()
3636

3737
@staticmethod
3838
def _is_event_tag_present_when_required(event):

nova/api/openstack/compute/server_metadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ class ServerMetadataController(wsgi.Controller):
3030
"""The server metadata API controller for the OpenStack API."""
3131

3232
def __init__(self):
33-
self.compute_api = compute.API()
3433
super(ServerMetadataController, self).__init__()
34+
self.compute_api = compute.API()
3535

3636
def _get_metadata(self, context, server_id):
3737
server = common.get_instance(self.compute_api, context, server_id)

0 commit comments

Comments
 (0)