From 79402586ca828a9926ad5af4b2d38273e0e06e19 Mon Sep 17 00:00:00 2001 From: zhufl Date: Mon, 27 Jun 2016 15:23:00 +0800 Subject: [PATCH] Remove unnecessary __init__ This is to remove unnecessary __init__ to keep code clean. Change-Id: Ib9f2d39122ea4bb24c864ba13afaf07f4b3a7a33 --- nova/api/openstack/compute/extended_status.py | 3 --- nova/api/openstack/compute/extended_volumes.py | 3 --- nova/api/openstack/compute/flavor_access.py | 4 ---- nova/api/openstack/compute/flavors_extraspecs.py | 4 ---- nova/console/api.py | 4 ---- nova/network/base_api.py | 3 --- nova/volume/encryptors/luks.py | 3 --- nova/volume/encryptors/nop.py | 3 --- 8 files changed, 27 deletions(-) diff --git a/nova/api/openstack/compute/extended_status.py b/nova/api/openstack/compute/extended_status.py index 13ec50f944ea..5814687a5054 100644 --- a/nova/api/openstack/compute/extended_status.py +++ b/nova/api/openstack/compute/extended_status.py @@ -22,9 +22,6 @@ authorize = extensions.os_compute_soft_authorizer(ALIAS) class ExtendedStatusController(wsgi.Controller): - def __init__(self, *args, **kwargs): - super(ExtendedStatusController, self).__init__(*args, **kwargs) - def _extend_server(self, server, instance): # Note(gmann): Removed 'locked_by' from extended status # to make it same as V2. If needed it can be added with diff --git a/nova/api/openstack/compute/extended_volumes.py b/nova/api/openstack/compute/extended_volumes.py index 49037795d90d..605c03549692 100644 --- a/nova/api/openstack/compute/extended_volumes.py +++ b/nova/api/openstack/compute/extended_volumes.py @@ -23,9 +23,6 @@ soft_authorize = extensions.os_compute_soft_authorizer(ALIAS) class ExtendedVolumesController(wsgi.Controller): - def __init__(self, *args, **kwargs): - super(ExtendedVolumesController, self).__init__(*args, **kwargs) - def _extend_server(self, context, server, req, bdms): volumes_attached = [] for bdm in bdms: diff --git a/nova/api/openstack/compute/flavor_access.py b/nova/api/openstack/compute/flavor_access.py index 50439d22846b..439788106291 100644 --- a/nova/api/openstack/compute/flavor_access.py +++ b/nova/api/openstack/compute/flavor_access.py @@ -43,10 +43,6 @@ def _marshall_flavor_access(flavor): class FlavorAccessController(wsgi.Controller): """The flavor access API controller for the OpenStack API.""" - - def __init__(self): - super(FlavorAccessController, self).__init__() - @extensions.expected_errors(404) def index(self, req, flavor_id): context = req.environ['nova.context'] diff --git a/nova/api/openstack/compute/flavors_extraspecs.py b/nova/api/openstack/compute/flavors_extraspecs.py index 6482cfe67d25..2547f67bb481 100644 --- a/nova/api/openstack/compute/flavors_extraspecs.py +++ b/nova/api/openstack/compute/flavors_extraspecs.py @@ -31,10 +31,6 @@ authorize = extensions.os_compute_authorizer(ALIAS) class FlavorExtraSpecsController(wsgi.Controller): """The flavor extra specs API controller for the OpenStack API.""" - - def __init__(self, *args, **kwargs): - super(FlavorExtraSpecsController, self).__init__(*args, **kwargs) - def _get_extra_specs(self, context, flavor_id): flavor = common.get_flavor(context, flavor_id) return dict(extra_specs=flavor.extra_specs) diff --git a/nova/console/api.py b/nova/console/api.py index 1bba7bf727e2..5bada8454624 100644 --- a/nova/console/api.py +++ b/nova/console/api.py @@ -27,10 +27,6 @@ CONF = nova.conf.CONF class API(base.Base): """API for spinning up or down console proxy connections.""" - - def __init__(self, **kwargs): - super(API, self).__init__(**kwargs) - def get_consoles(self, context, instance_uuid): return self.db.console_get_all_by_instance(context, instance_uuid, columns_to_join=['pool']) diff --git a/nova/network/base_api.py b/nova/network/base_api.py index c5740199af28..010cfcd63ee5 100644 --- a/nova/network/base_api.py +++ b/nova/network/base_api.py @@ -89,9 +89,6 @@ class NetworkAPI(base.Base): """Base Network API for doing networking operations. New operations available on specific clients must be added here as well. """ - def __init__(self, **kwargs): - super(NetworkAPI, self).__init__(**kwargs) - def get_all(self, context): """Get all the networks for client.""" raise NotImplementedError() diff --git a/nova/volume/encryptors/luks.py b/nova/volume/encryptors/luks.py index ca2a36b55679..c6c55ce0df36 100644 --- a/nova/volume/encryptors/luks.py +++ b/nova/volume/encryptors/luks.py @@ -50,9 +50,6 @@ class LuksEncryptor(cryptsetup.CryptsetupEncryptor): This VolumeEncryptor uses dm-crypt to encrypt the specified volume. """ - def __init__(self, connection_info, **kwargs): - super(LuksEncryptor, self).__init__(connection_info, **kwargs) - def _format_volume(self, passphrase, **kwargs): """Creates a LUKS header on the volume. diff --git a/nova/volume/encryptors/nop.py b/nova/volume/encryptors/nop.py index de0bfbf03d66..2d91f9fbe0d6 100644 --- a/nova/volume/encryptors/nop.py +++ b/nova/volume/encryptors/nop.py @@ -24,9 +24,6 @@ class NoOpEncryptor(base.VolumeEncryptor): volume. This implementation performs no action when a volume is attached or detached. """ - def __init__(self, connection_info, **kwargs): - super(NoOpEncryptor, self).__init__(connection_info, **kwargs) - def attach_volume(self, context): pass