Use class name in invocation of super

Fix pylint E103 warning raised by usage of
self.__class__ to refer to the derived class
in super() methods.

self.__class__ is a reasonable first argument
to super() in any method of a class, as long
as the method is not going to be invoked in
derived classes.

Python3 removes this ambiguity by not requiring
arguments for the super() method.

[1] https://docs.pylint.org/en/1.6.0/features.html#id33

Change-Id: I6071b6cfd8cff2be3853d739f71b94da990cda97
This commit is contained in:
Goutham Pacha Ravi 2018-06-06 16:50:44 -07:00
parent 7f990ffa16
commit fd23a6387c
45 changed files with 88 additions and 88 deletions

View File

@ -118,7 +118,7 @@ class ShareManageController(ShareManageMixin, wsgi.Controller):
_view_builder_class = share_views.ViewBuilder
def __init__(self, *args, **kwargs):
super(self.__class__, self).__init__(*args, **kwargs)
super(ShareManageController, self).__init__(*args, **kwargs)
self.share_api = share.API()
@wsgi.Controller.api_version('1.0', '2.6')

View File

@ -74,7 +74,7 @@ class ShareUnmanageController(ShareUnmanageMixin, wsgi.Controller):
resource_name = "share"
def __init__(self, *args, **kwargs):
super(self.__class__, self).__init__(*args, **kwargs)
super(ShareUnmanageController, self).__init__(*args, **kwargs)
self.share_api = share.API()
@wsgi.Controller.api_version('1.0', '2.6')

View File

@ -502,7 +502,7 @@ class ShareController(wsgi.Controller, ShareMixin, wsgi.AdminActionsMixin):
_view_builder_class = share_views.ViewBuilder
def __init__(self):
super(self.__class__, self).__init__()
super(ShareController, self).__init__()
self.share_api = share.API()
self._access_view_builder = share_access_views.ViewBuilder()

View File

@ -28,7 +28,7 @@ class ShareExportLocationController(wsgi.Controller):
def __init__(self):
self._view_builder_class = export_locations_views.ViewBuilder
self.resource_name = 'share_export_location'
super(self.__class__, self).__init__()
super(ShareExportLocationController, self).__init__()
def _verify_share(self, context, share_id):
try:

View File

@ -29,7 +29,7 @@ class ShareInstanceExportLocationController(wsgi.Controller):
def __init__(self):
self._view_builder_class = export_locations_views.ViewBuilder
self.resource_name = 'share_instance_export_location'
super(self.__class__, self).__init__()
super(ShareInstanceExportLocationController, self).__init__()
def _verify_share_instance(self, context, share_instance_id):
try:

View File

@ -31,7 +31,7 @@ class ShareInstancesController(wsgi.Controller, wsgi.AdminActionsMixin):
def __init__(self):
self.share_api = share.API()
super(self.__class__, self).__init__()
super(ShareInstancesController, self).__init__()
def _get(self, *args, **kwargs):
return db.share_instance_get(*args, **kwargs)

View File

@ -29,7 +29,7 @@ class ShareSnapshotExportLocationController(wsgi.Controller):
self._view_builder_class = (
share_snapshot_export_locations.ViewBuilder)
self.resource_name = 'share_snapshot_export_location'
super(self.__class__, self).__init__()
super(ShareSnapshotExportLocationController, self).__init__()
@wsgi.Controller.api_version('2.32')
@wsgi.Controller.authorize

View File

@ -29,7 +29,7 @@ class ShareSnapshotInstanceExportLocationController(wsgi.Controller):
self._view_builder_class = (
share_snapshot_export_locations.ViewBuilder)
self.resource_name = 'share_snapshot_instance_export_location'
super(self.__class__, self).__init__()
super(ShareSnapshotInstanceExportLocationController, self).__init__()
@wsgi.Controller.api_version('2.32')
@wsgi.Controller.authorize

View File

@ -32,7 +32,7 @@ class ShareSnapshotInstancesController(wsgi.Controller,
def __init__(self):
self.share_api = share.API()
super(self.__class__, self).__init__()
super(ShareSnapshotInstancesController, self).__init__()
@wsgi.Controller.api_version('2.19')
@wsgi.Controller.authorize

View File

@ -47,7 +47,7 @@ class ShareTypesController(wsgi.Controller):
def __getattr__(self, key):
if key == 'os-share-type-access':
return self.share_type_access
return super(self.__class__, self).__getattr__(key)
return super(ShareTypesController, self).__getattr__(key)
def _notify_share_type_error(self, context, method, payload):
rpc.get_notifier('shareType').error(context, method, payload)

View File

@ -47,7 +47,7 @@ class ShareController(shares.ShareMixin,
_view_builder_class = share_views.ViewBuilder
def __init__(self):
super(self.__class__, self).__init__()
super(ShareController, self).__init__()
self.share_api = share.API()
self._access_view_builder = share_access_views.ViewBuilder()
self._migration_view_builder = share_migration_views.ViewBuilder()

View File

@ -81,7 +81,7 @@ class SchedulerManager(manager.Manager):
self.driver = importutils.import_object(scheduler_driver)
self.message_api = message_api.API()
super(self.__class__, self).__init__(*args, **kwargs)
super(SchedulerManager, self).__init__(*args, **kwargs)
def init_host(self):
ctxt = context.get_admin_context()

View File

@ -49,7 +49,7 @@ class HitachiHSPDriver(driver.ShareDriver):
"""
def __init__(self, *args, **kwargs):
super(self.__class__, self).__init__(
super(HitachiHSPDriver, self).__init__(
[False], *args, config_opts=[hitachi_hsp_opts], **kwargs)
self.private_storage = kwargs.get('private_storage')

View File

@ -275,7 +275,7 @@ class QnapShareDriver(driver.ShareDriver):
'driver_handles_share_servers'),
'pools': [single_pool],
}
super(self.__class__, self)._update_share_stats(data)
super(QnapShareDriver, self)._update_share_stats(data)
@utils.retry(exception=exception.ShareBackendException,
interval=3,

View File

@ -164,7 +164,7 @@ def get_backend_configuration(backend_name):
class ZFSonLinuxShareDriver(zfs_utils.ExecuteMixin, driver.ShareDriver):
def __init__(self, *args, **kwargs):
super(self.__class__, self).__init__(
super(ZFSonLinuxShareDriver, self).__init__(
[False], *args, config_opts=[zfsonlinux_opts], **kwargs)
self.replica_snapshot_prefix = (
self.configuration.zfs_replica_snapshot_prefix)
@ -325,7 +325,7 @@ class ZFSonLinuxShareDriver(zfs_utils.ExecuteMixin, driver.ShareDriver):
def do_setup(self, context):
"""Perform basic setup and checks."""
super(self.__class__, self).do_setup(context)
super(ZFSonLinuxShareDriver, self).do_setup(context)
self._setup_helpers()
for ip in (self.share_export_ip, self.service_ip):
if not utils.is_valid_ip_address(ip, 4):
@ -382,7 +382,7 @@ class ZFSonLinuxShareDriver(zfs_utils.ExecuteMixin, driver.ShareDriver):
}
if self.configuration.replication_domain:
data['replication_type'] = 'readable'
super(self.__class__, self)._update_share_stats(data)
super(ZFSonLinuxShareDriver, self)._update_share_stats(data)
def _get_share_name(self, share_id):
"""Returns name of dataset used for given share."""

View File

@ -37,7 +37,7 @@ class ShareSnapshotAPITest(test.TestCase):
"""Share Snapshot API Test."""
def setUp(self):
super(self.__class__, self).setUp()
super(ShareSnapshotAPITest, self).setUp()
self.controller = share_snapshots.ShareSnapshotsController()
self.mock_object(share_api.API, 'get', stubs.stub_share_get)
@ -353,7 +353,7 @@ class ShareSnapshotAPITest(test.TestCase):
class ShareSnapshotAdminActionsAPITest(test.TestCase):
def setUp(self):
super(self.__class__, self).setUp()
super(ShareSnapshotAdminActionsAPITest, self).setUp()
self.controller = share_snapshots.ShareSnapshotsController()
self.flags(rpc_backend='manila.openstack.common.rpc.impl_fake')
self.admin_context = context.RequestContext('admin', 'fake', True)

View File

@ -46,7 +46,7 @@ class ShareAPITest(test.TestCase):
"""Share API Test."""
def setUp(self):
super(self.__class__, self).setUp()
super(ShareAPITest, self).setUp()
self.controller = shares.ShareController()
self.mock_object(db, 'availability_zone_get')
self.mock_object(share_api.API, 'get_all',
@ -778,7 +778,7 @@ def _fake_access_get(self, ctxt, access_id):
class ShareActionsTest(test.TestCase):
def setUp(self):
super(self.__class__, self).setUp()
super(ShareActionsTest, self).setUp()
self.controller = shares.ShareController()
self.mock_object(share_api.API, 'get', stubs.stub_share_get)
self.mock_policy_check = self.mock_object(policy, 'check_policy')
@ -1000,7 +1000,7 @@ class ShareActionsTest(test.TestCase):
class ShareAdminActionsAPITest(test.TestCase):
def setUp(self):
super(self.__class__, self).setUp()
super(ShareAdminActionsAPITest, self).setUp()
CONF.set_default("default_share_type", None)
self.flags(rpc_backend='manila.openstack.common.rpc.impl_fake')
self.share_api = share_api.API()

View File

@ -49,7 +49,7 @@ REQ_MEMBER.environ['manila.context'].is_admin = False
class QuotaSetsControllerTest(test.TestCase):
def setUp(self):
super(self.__class__, self).setUp()
super(QuotaSetsControllerTest, self).setUp()
self.controller = quota_class_sets.QuotaClassSetsController()
self.resource_name = self.controller.resource_name
self.class_name = 'foo_class_name'

View File

@ -53,7 +53,7 @@ def _get_request(is_admin, user_in_url):
class QuotaSetsControllerTest(test.TestCase):
def setUp(self):
super(self.__class__, self).setUp()
super(QuotaSetsControllerTest, self).setUp()
self.controller = quota_sets.QuotaSetsController()
self.resource_name = self.controller.resource_name
self.project_id = 'foo_project_id'

View File

@ -142,7 +142,7 @@ def fake_utcnow():
class ServicesTest(test.TestCase):
def setUp(self):
super(self.__class__, self).setUp()
super(ServicesTest, self).setUp()
self.mock_object(db, "service_get_all", fake_service_get_all)
self.mock_object(timeutils, "utcnow", fake_utcnow)

View File

@ -37,7 +37,7 @@ class ShareExportLocationsAPITest(test.TestCase):
return req
def setUp(self):
super(self.__class__, self).setUp()
super(ShareExportLocationsAPITest, self).setUp()
self.controller = (
export_locations.ShareExportLocationController())
self.resource_name = self.controller.resource_name

View File

@ -42,7 +42,7 @@ CONF = cfg.CONF
class ShareGroupSnapshotAPITest(test.TestCase):
def setUp(self):
super(self.__class__, self).setUp()
super(ShareGroupSnapshotAPITest, self).setUp()
self.controller = share_group_snapshots.ShareGroupSnapshotController()
self.resource_name = self.controller.resource_name
self.api_version = '2.31'

View File

@ -70,7 +70,7 @@ def fake_request(url, admin=False, experimental=True, version='2.31',
class ShareGroupTypesAPITest(test.TestCase):
def setUp(self):
super(self.__class__, self).setUp()
super(ShareGroupTypesAPITest, self).setUp()
self.flags(host='fake')
self.controller = types.ShareGroupTypesController()
self.resource_name = self.controller.resource_name
@ -434,7 +434,7 @@ class ShareGroupTypesAPITest(test.TestCase):
class ShareGroupTypeAccessTest(test.TestCase):
def setUp(self):
super(self.__class__, self).setUp()
super(ShareGroupTypeAccessTest, self).setUp()
self.controller = types.ShareGroupTypesController()
def test_list_type_access_public(self):

View File

@ -47,7 +47,7 @@ class ShareGroupAPITest(test.TestCase):
"""Consistency Groups API Test suite."""
def setUp(self):
super(self.__class__, self).setUp()
super(ShareGroupAPITest, self).setUp()
self.controller = share_groups.ShareGroupController()
self.resource_name = self.controller.resource_name
self.fake_share_type = {'id': six.text_type(uuidutils.generate_uuid())}

View File

@ -37,7 +37,7 @@ class ShareInstanceExportLocationsAPITest(test.TestCase):
return req
def setUp(self):
super(self.__class__, self).setUp()
super(ShareInstanceExportLocationsAPITest, self).setUp()
self.controller = (
export_locations.ShareInstanceExportLocationController())
self.resource_name = self.controller.resource_name

View File

@ -36,7 +36,7 @@ class ShareInstancesAPITest(test.TestCase):
"""Share instances API Test."""
def setUp(self):
super(self.__class__, self).setUp()
super(ShareInstancesAPITest, self).setUp()
self.controller = share_instances.ShareInstancesController()
self.resource_name = self.controller.resource_name
self.mock_policy_check = self.mock_object(

View File

@ -55,7 +55,7 @@ class ShareSnapshotAPITest(test.TestCase):
"""Share Snapshot API Test."""
def setUp(self):
super(self.__class__, self).setUp()
super(ShareSnapshotAPITest, self).setUp()
self.controller = share_snapshots.ShareSnapshotsController()
self.mock_object(share_api.API, 'get', stubs.stub_share_get)
@ -579,7 +579,7 @@ class ShareSnapshotAPITest(test.TestCase):
class ShareSnapshotAdminActionsAPITest(test.TestCase):
def setUp(self):
super(self.__class__, self).setUp()
super(ShareSnapshotAdminActionsAPITest, self).setUp()
self.controller = share_snapshots.ShareSnapshotsController()
self.flags(rpc_backend='manila.openstack.common.rpc.impl_fake')
self.admin_context = context.RequestContext('admin', 'fake', True)

View File

@ -119,7 +119,7 @@ def make_create_body(name="test_share_1", extra_specs=None,
class ShareTypesAPITest(test.TestCase):
def setUp(self):
super(self.__class__, self).setUp()
super(ShareTypesAPITest, self).setUp()
self.flags(host='fake')
self.controller = types.ShareTypesController()
self.resource_name = self.controller.resource_name
@ -569,7 +569,7 @@ class FakeRequest(object):
class ShareTypeAccessTest(test.TestCase):
def setUp(self):
super(self.__class__, self).setUp()
super(ShareTypeAccessTest, self).setUp()
self.controller = types.ShareTypesController()
self.req = FakeRequest()
self.mock_object(db, 'share_type_get', fake_share_type_get)

View File

@ -51,7 +51,7 @@ class ShareAPITest(test.TestCase):
"""Share API Test."""
def setUp(self):
super(self.__class__, self).setUp()
super(ShareAPITest, self).setUp()
self.controller = shares.ShareController()
self.mock_object(db, 'availability_zone_get')
self.mock_object(share_api.API, 'get_all',
@ -1910,7 +1910,7 @@ def _fake_access_get(self, ctxt, access_id):
class ShareActionsTest(test.TestCase):
def setUp(self):
super(self.__class__, self).setUp()
super(ShareActionsTest, self).setUp()
self.controller = shares.ShareController()
self.mock_object(share_api.API, 'get', stubs.stub_share_get)
@ -2321,7 +2321,7 @@ class ShareActionsTest(test.TestCase):
class ShareAdminActionsAPITest(test.TestCase):
def setUp(self):
super(self.__class__, self).setUp()
super(ShareAdminActionsAPITest, self).setUp()
CONF.set_default("default_share_type", None)
self.flags(rpc_backend='manila.openstack.common.rpc.impl_fake')
self.share_api = share_api.API()
@ -2442,7 +2442,7 @@ class ShareAdminActionsAPITest(test.TestCase):
class ShareUnmanageTest(test.TestCase):
def setUp(self):
super(self.__class__, self).setUp()
super(ShareUnmanageTest, self).setUp()
self.controller = shares.ShareController()
self.mock_object(share_api.API, 'get_all',
stubs.stub_get_all_shares)
@ -2587,7 +2587,7 @@ def get_fake_manage_body(export_path='/fake', service_host='fake@host#POOL',
class ShareManageTest(test.TestCase):
def setUp(self):
super(self.__class__, self).setUp()
super(ShareManageTest, self).setUp()
self.controller = shares.ShareController()
self.resource_name = self.controller.resource_name
self.request = fakes.HTTPRequest.blank(

View File

@ -1499,7 +1499,7 @@ class ShareSnapshotDatabaseAPITestCase(test.TestCase):
class ShareExportLocationsDatabaseAPITestCase(test.TestCase):
def setUp(self):
super(self.__class__, self).setUp()
super(ShareExportLocationsDatabaseAPITestCase, self).setUp()
self.ctxt = context.get_admin_context()
def test_update_valid_order(self):
@ -1597,7 +1597,8 @@ class ShareExportLocationsDatabaseAPITestCase(test.TestCase):
class ShareInstanceExportLocationsMetadataDatabaseAPITestCase(test.TestCase):
def setUp(self):
super(self.__class__, self).setUp()
clname = ShareInstanceExportLocationsMetadataDatabaseAPITestCase
super(clname, self).setUp()
self.ctxt = context.get_admin_context()
share_id = 'fake_share_id'
instances = [
@ -2868,7 +2869,7 @@ class PurgeDeletedTest(test.TestCase):
class ShareTypeAPITestCase(test.TestCase):
def setUp(self):
super(self.__class__, self).setUp()
super(ShareTypeAPITestCase, self).setUp()
self.ctxt = context.RequestContext(
user_id='user_id', project_id='project_id', is_admin=True)

View File

@ -48,7 +48,6 @@ CONF = cfg.CONF
class SchedulerManagerTestCase(test.TestCase):
"""Test case for scheduler manager."""
manager_cls = manager.SchedulerManager
driver_cls = base.Scheduler
driver_cls_name = 'manila.scheduler.drivers.base.Scheduler'
@ -68,7 +67,7 @@ class SchedulerManagerTestCase(test.TestCase):
reload(manager)
self.flags(scheduler_driver=self.driver_cls_name)
self.manager = self.manager_cls()
self.manager = manager.SchedulerManager()
self.context = context.RequestContext('fake_user', 'fake_project')
self.topic = 'fake_topic'
self.fake_args = (1, 2, 3)

View File

@ -124,7 +124,7 @@ class StorageObjectTestCase(StorageObjectTestCaseBase):
class FileSystemTestCase(StorageObjectTestCaseBase):
def setUp(self):
super(self.__class__, self).setUp()
super(FileSystemTestCase, self).setUp()
self.hook = utils.RequestSideEffect()
self.ssh_hook = utils.SSHSideEffect()
@ -537,7 +537,7 @@ class FileSystemTestCase(StorageObjectTestCaseBase):
class MountPointTestCase(StorageObjectTestCaseBase):
def setUp(self):
super(self.__class__, self).setUp()
super(MountPointTestCase, self).setUp()
self.hook = utils.RequestSideEffect()
def test_create_mount_point_on_vdm(self):
@ -854,7 +854,7 @@ class MountPointTestCase(StorageObjectTestCaseBase):
class VDMTestCase(StorageObjectTestCaseBase):
def setUp(self):
super(self.__class__, self).setUp()
super(VDMTestCase, self).setUp()
self.hook = utils.RequestSideEffect()
self.ssh_hook = utils.SSHSideEffect()
@ -1118,7 +1118,7 @@ class VDMTestCase(StorageObjectTestCaseBase):
class StoragePoolTestCase(StorageObjectTestCaseBase):
def setUp(self):
super(self.__class__, self).setUp()
super(StoragePoolTestCase, self).setUp()
self.hook = utils.RequestSideEffect()
def test_get_pool(self):
@ -1185,7 +1185,7 @@ class StoragePoolTestCase(StorageObjectTestCaseBase):
class MoverTestCase(StorageObjectTestCaseBase):
def setUp(self):
super(self.__class__, self).setUp()
super(MoverTestCase, self).setUp()
self.hook = utils.RequestSideEffect()
self.ssh_hook = utils.SSHSideEffect()
@ -1362,7 +1362,7 @@ class MoverTestCase(StorageObjectTestCaseBase):
class SnapshotTestCase(StorageObjectTestCaseBase):
def setUp(self):
super(self.__class__, self).setUp()
super(SnapshotTestCase, self).setUp()
self.hook = utils.RequestSideEffect()
def test_create_snapshot(self):
@ -1552,7 +1552,7 @@ class SnapshotTestCase(StorageObjectTestCaseBase):
@ddt.ddt
class MoverInterfaceTestCase(StorageObjectTestCaseBase):
def setUp(self):
super(self.__class__, self).setUp()
super(MoverInterfaceTestCase, self).setUp()
self.hook = utils.RequestSideEffect()
def test_create_mover_interface(self):
@ -1845,7 +1845,7 @@ class MoverInterfaceTestCase(StorageObjectTestCaseBase):
class DNSDomainTestCase(StorageObjectTestCaseBase):
def setUp(self):
super(self.__class__, self).setUp()
super(DNSDomainTestCase, self).setUp()
self.hook = utils.RequestSideEffect()
def test_create_dns_domain(self):
@ -1955,7 +1955,7 @@ class DNSDomainTestCase(StorageObjectTestCaseBase):
class CIFSServerTestCase(StorageObjectTestCaseBase):
def setUp(self):
super(self.__class__, self).setUp()
super(CIFSServerTestCase, self).setUp()
self.hook = utils.RequestSideEffect()
def test_create_cifs_server(self):
@ -2393,7 +2393,7 @@ class CIFSServerTestCase(StorageObjectTestCaseBase):
class CIFSShareTestCase(StorageObjectTestCaseBase):
def setUp(self):
super(self.__class__, self).setUp()
super(CIFSShareTestCase, self).setUp()
self.hook = utils.RequestSideEffect()
self.ssh_hook = utils.SSHSideEffect()
@ -2799,7 +2799,7 @@ class CIFSShareTestCase(StorageObjectTestCaseBase):
class NFSShareTestCase(StorageObjectTestCaseBase):
def setUp(self):
super(self.__class__, self).setUp()
super(NFSShareTestCase, self).setUp()
self.ssh_hook = utils.SSHSideEffect()
def test_create_nfs_share(self):

View File

@ -126,7 +126,7 @@ class StorageObjectTestCase(StorageObjectTestCaseBase):
class FileSystemTestCase(StorageObjectTestCaseBase):
def setUp(self):
super(self.__class__, self).setUp()
super(FileSystemTestCase, self).setUp()
self.hook = utils.RequestSideEffect()
self.ssh_hook = utils.SSHSideEffect()
@ -539,7 +539,7 @@ class FileSystemTestCase(StorageObjectTestCaseBase):
class MountPointTestCase(StorageObjectTestCaseBase):
def setUp(self):
super(self.__class__, self).setUp()
super(MountPointTestCase, self).setUp()
self.hook = utils.RequestSideEffect()
def test_create_mount_point_on_vdm(self):
@ -857,7 +857,7 @@ class MountPointTestCase(StorageObjectTestCaseBase):
@ddt.ddt
class VDMTestCase(StorageObjectTestCaseBase):
def setUp(self):
super(self.__class__, self).setUp()
super(VDMTestCase, self).setUp()
self.hook = utils.RequestSideEffect()
self.ssh_hook = utils.SSHSideEffect()
@ -1123,7 +1123,7 @@ class VDMTestCase(StorageObjectTestCaseBase):
class StoragePoolTestCase(StorageObjectTestCaseBase):
def setUp(self):
super(self.__class__, self).setUp()
super(StoragePoolTestCase, self).setUp()
self.hook = utils.RequestSideEffect()
def test_get_pool(self):
@ -1190,7 +1190,7 @@ class StoragePoolTestCase(StorageObjectTestCaseBase):
class MoverTestCase(StorageObjectTestCaseBase):
def setUp(self):
super(self.__class__, self).setUp()
super(MoverTestCase, self).setUp()
self.hook = utils.RequestSideEffect()
self.ssh_hook = utils.SSHSideEffect()
@ -1367,7 +1367,7 @@ class MoverTestCase(StorageObjectTestCaseBase):
class SnapshotTestCase(StorageObjectTestCaseBase):
def setUp(self):
super(self.__class__, self).setUp()
super(SnapshotTestCase, self).setUp()
self.hook = utils.RequestSideEffect()
def test_create_snapshot(self):
@ -1557,7 +1557,7 @@ class SnapshotTestCase(StorageObjectTestCaseBase):
@ddt.ddt
class MoverInterfaceTestCase(StorageObjectTestCaseBase):
def setUp(self):
super(self.__class__, self).setUp()
super(MoverInterfaceTestCase, self).setUp()
self.hook = utils.RequestSideEffect()
def test_create_mover_interface(self):
@ -1850,7 +1850,7 @@ class MoverInterfaceTestCase(StorageObjectTestCaseBase):
class DNSDomainTestCase(StorageObjectTestCaseBase):
def setUp(self):
super(self.__class__, self).setUp()
super(DNSDomainTestCase, self).setUp()
self.hook = utils.RequestSideEffect()
def test_create_dns_domain(self):
@ -1960,7 +1960,7 @@ class DNSDomainTestCase(StorageObjectTestCaseBase):
class CIFSServerTestCase(StorageObjectTestCaseBase):
def setUp(self):
super(self.__class__, self).setUp()
super(CIFSServerTestCase, self).setUp()
self.hook = utils.RequestSideEffect()
def test_create_cifs_server(self):
@ -2398,7 +2398,7 @@ class CIFSServerTestCase(StorageObjectTestCaseBase):
class CIFSShareTestCase(StorageObjectTestCaseBase):
def setUp(self):
super(self.__class__, self).setUp()
super(CIFSShareTestCase, self).setUp()
self.hook = utils.RequestSideEffect()
self.ssh_hook = utils.SSHSideEffect()
@ -2804,7 +2804,7 @@ class CIFSShareTestCase(StorageObjectTestCaseBase):
class NFSShareTestCase(StorageObjectTestCaseBase):
def setUp(self):
super(self.__class__, self).setUp()
super(NFSShareTestCase, self).setUp()
self.ssh_hook = utils.SSHSideEffect()
def test_create_nfs_share(self):

View File

@ -133,7 +133,7 @@ class DummyDriver(driver.ShareDriver):
def __init__(self, *args, **kwargs):
"""Do initialization."""
super(self.__class__, self).__init__(
super(DummyDriver, self).__init__(
[False, True], *args, config_opts=[dummy_opts], **kwargs)
self._verify_configuration()
self.private_storage = kwargs.get('private_storage')
@ -393,7 +393,7 @@ class DummyDriver(driver.ShareDriver):
}
if self.configuration.replication_domain:
data["replication_type"] = "readable"
super(self.__class__, self)._update_share_stats(data)
super(DummyDriver, self)._update_share_stats(data)
def get_share_server_pools(self, share_server):
"""Return list of pools related to a particular share server."""

View File

@ -768,7 +768,7 @@ class FakeHuaweiNasHelper(helper.RestHelper):
class FakeRpcClient(rpcapi.HuaweiV3API):
def __init__(self, helper):
super(self.__class__, self).__init__()
super(FakeRpcClient, self).__init__()
self.replica_mgr = replication.ReplicaPairManager(helper)
class fake_call_context(object):
@ -784,7 +784,7 @@ class FakeRpcClient(rpcapi.HuaweiV3API):
remote_device_wwn, remote_fs_id):
self.client.prepare = mock.Mock(
return_value=self.fake_call_context(self.replica_mgr))
return super(self.__class__, self).create_replica_pair(
return super(FakeRpcClient, self).create_replica_pair(
context, host, local_share_info,
remote_device_wwn, remote_fs_id)

View File

@ -27,10 +27,10 @@ PATH_TO_RPC = 'manila.share.drivers.nexenta.ns5.jsonrpc.NexentaJSONProxy'
class TestNexentaJSONProxy(test.TestCase):
def __init__(self, method):
super(self.__class__, self).__init__(method)
super(TestNexentaJSONProxy, self).__init__(method)
def setUp(self):
super(self.__class__, self).setUp()
super(TestNexentaJSONProxy, self).setUp()
self.nef_get = jsonrpc.NexentaJSONProxy(
'http', '1.1.1.1', '8080', 'user', 'pass', 'get')
self.nef_post = jsonrpc.NexentaJSONProxy(

View File

@ -36,7 +36,7 @@ class TestNexentaNasDriver(test.TestCase):
return getattr(self.cfg, opt)
self.cfg = conf.Configuration(None)
self.cfg.nexenta_host = '1.1.1.1'
super(self.__class__, self).setUp()
super(TestNexentaNasDriver, self).setUp()
self.ctx = context.get_admin_context()
self.mock_object(
self.cfg, 'safe_get', mock.Mock(side_effect=_safe_get))

View File

@ -143,7 +143,7 @@ class ZFSonLinuxShareDriverTestCase(test.TestCase):
def setUp(self):
self.mock_object(zfs_driver.CONF, '_check_required_opts')
super(self.__class__, self).setUp()
super(ZFSonLinuxShareDriverTestCase, self).setUp()
self._context = context.get_admin_context()
self.ssh_executor = self.mock_object(ganesha_utils, 'SSHExecutor')
self.configuration = FakeConfig()

View File

@ -55,7 +55,7 @@ class FakeShareDriver(zfs_utils.ExecuteMixin):
class ExecuteMixinTestCase(test.TestCase):
def setUp(self):
super(self.__class__, self).setUp()
super(ExecuteMixinTestCase, self).setUp()
self.ssh_executor = self.mock_object(ganesha_utils, 'SSHExecutor')
self.driver = FakeShareDriver()
@ -238,7 +238,7 @@ foo_res opt_3 some_value local"""
class NFSviaZFSHelperTestCase(test.TestCase):
def setUp(self):
super(self.__class__, self).setUp()
super(NFSviaZFSHelperTestCase, self).setUp()
configuration = get_fake_configuration()
self.out = "fake_out"
self.mock_object(

View File

@ -39,7 +39,7 @@ class LockedOperationsTestCase(test.TestCase):
pass
def setUp(self):
super(self.__class__, self).setUp()
super(LockedOperationsTestCase, self).setUp()
self.access_helper = self.FakeAccessHelper()
self.context = context.RequestContext('fake_user', 'fake_project')
self.lock_call = self.mock_object(
@ -59,7 +59,7 @@ class LockedOperationsTestCase(test.TestCase):
class ShareInstanceAccessDatabaseMixinTestCase(test.TestCase):
def setUp(self):
super(self.__class__, self).setUp()
super(ShareInstanceAccessDatabaseMixinTestCase, self).setUp()
self.driver = mock.Mock()
self.access_helper = access.ShareInstanceAccess(db, self.driver)
self.context = context.RequestContext('fake_user', 'fake_project')

View File

@ -67,7 +67,7 @@ class LockedOperationsTestCase(test.TestCase):
pass
def setUp(self):
super(self.__class__, self).setUp()
super(LockedOperationsTestCase, self).setUp()
self.manager = self.FakeManager()
self.fake_context = test_fakes.FakeRequestContext
self.lock_call = self.mock_object(

View File

@ -27,7 +27,7 @@ from manila import test
class ManagerTestCase(test.TestCase):
def setUp(self):
super(self.__class__, self).setUp()
super(ManagerTestCase, self).setUp()
self.host = 'host'
self.db_driver = 'fake_driver'
self.mock_object(importutils, 'import_module')
@ -60,7 +60,7 @@ class ManagerTestCase(test.TestCase):
class SchedulerDependentManagerTestCase(test.TestCase):
def setUp(self):
super(self.__class__, self).setUp()
super(SchedulerDependentManagerTestCase, self).setUp()
self.context = 'fake_context'
self.host = 'host'
self.db_driver = 'fake_driver'

View File

@ -28,7 +28,7 @@ CONF = cfg.CONF
class APITestCase(test.TestCase):
def setUp(self):
super(self.__class__, self).setUp()
super(APITestCase, self).setUp()
self.mock_object(importutils, 'import_class')
def test_init_api_with_default_config_group_name(self):
@ -65,7 +65,7 @@ class APITestCase(test.TestCase):
class NetworkBaseAPITestCase(test.TestCase):
def setUp(self):
super(self.__class__, self).setUp()
super(NetworkBaseAPITestCase, self).setUp()
self.db_driver = 'fake_driver'
self.mock_object(importutils, 'import_module')

View File

@ -28,7 +28,7 @@ CONF = cfg.CONF
class DbQuotaDriverTestCase(test.TestCase):
def setUp(self):
super(self.__class__, self).setUp()
super(DbQuotaDriverTestCase, self).setUp()
self.project_id = 'fake_project_id'
self.user_id = 'fake_user_id'
self.share_type_id = 'fake_share_type_id'
@ -462,7 +462,7 @@ class DbQuotaDriverTestCase(test.TestCase):
class QuotaEngineTestCase(test.TestCase):
def setUp(self):
super(self.__class__, self).setUp()
super(QuotaEngineTestCase, self).setUp()
self.ctxt = 'fake_context'
self.mock_class('manila.quota.DbQuotaDriver')
self.engine = quota.QuotaEngine()

View File

@ -203,7 +203,7 @@ class ServiceTestCase(test.TestCase):
class TestWSGIService(test.TestCase):
def setUp(self):
super(self.__class__, self).setUp()
super(TestWSGIService, self).setUp()
self.mock_object(wsgi.Loader, 'load_app')
self.test_service = service.WSGIService("test_service")