diff --git a/manila/api/v2/share_group_types.py b/manila/api/v2/share_group_types.py index 4376625d7d..e80fa518c9 100644 --- a/manila/api/v2/share_group_types.py +++ b/manila/api/v2/share_group_types.py @@ -132,7 +132,7 @@ class ShareGroupTypesController(wsgi.Controller): if name is None or name == "" or len(name) > 255: msg = _("Share group type name is not valid.") raise webob.exc.HTTPBadRequest(explanation=msg) - if not (specs is None or isinstance(specs, dict)): + if not (specs is None or isinstance(specs, dict)): msg = _("Group specs can be either of 'None' or 'dict' types.") raise webob.exc.HTTPBadRequest(explanation=msg) if specs: diff --git a/manila/network/neutron/neutron_network_plugin.py b/manila/network/neutron/neutron_network_plugin.py index 3334f5afdf..3ef031221f 100644 --- a/manila/network/neutron/neutron_network_plugin.py +++ b/manila/network/neutron/neutron_network_plugin.py @@ -389,7 +389,7 @@ class NeutronNetworkPlugin(network.NetworkBaseAPI): provider_nw_dict = { 'network_type': network_type, 'segmentation_id': segmentation_id, - 'mtu': net_info['mtu'], + 'mtu': net_info['mtu'], } share_network_subnet.update(provider_nw_dict) @@ -608,7 +608,7 @@ class NeutronBindNetworkPlugin(NeutronNetworkPlugin): share_network_subnet['neutron_net_id']) mtu_dict = { - 'mtu': net_info['mtu'], + 'mtu': net_info['mtu'], } share_network_subnet.update(mtu_dict) diff --git a/manila/share/drivers/inspur/instorage/instorage.py b/manila/share/drivers/inspur/instorage/instorage.py index 34e6c04dbc..d2cf30e26d 100644 --- a/manila/share/drivers/inspur/instorage/instorage.py +++ b/manila/share/drivers/inspur/instorage/instorage.py @@ -117,7 +117,7 @@ class InStorageShareDriver(driver.ShareDriver): try: stats = { - 'share_backend_name': self.backend_name, + 'share_backend_name': self.backend_name, 'vendor_name': self.VENDOR, 'driver_version': self.VERSION, 'storage_protocol': 'NFS_CIFS', diff --git a/manila/share_group/api.py b/manila/share_group/api.py index aec8237012..1e194be833 100644 --- a/manila/share_group/api.py +++ b/manila/share_group/api.py @@ -501,5 +501,5 @@ class API(base.Base): def get_all_share_group_snapshot_members(self, context, share_group_snapshot_id): members = self.db.share_group_snapshot_members_get_all( - context, share_group_snapshot_id) + context, share_group_snapshot_id) return members diff --git a/manila/tests/api/v2/test_share_group_snapshots.py b/manila/tests/api/v2/test_share_group_snapshots.py index 59e24a776b..c7dd12c6a1 100644 --- a/manila/tests/api/v2/test_share_group_snapshots.py +++ b/manila/tests/api/v2/test_share_group_snapshots.py @@ -559,7 +559,7 @@ class ShareGroupSnapshotAPITest(test.TestCase): @ddt.data(*fakes.fixture_force_delete_with_different_roles) @ddt.unpack def test_share_group_snapshot_force_delete_with_different_roles( - self, role, resp_code, version): + self, role, resp_code, version): group_snap, req = self._setup_share_group_snapshot_data() ctxt = self._get_context(role) req.method = 'POST' diff --git a/manila/tests/api/v2/test_share_group_types.py b/manila/tests/api/v2/test_share_group_types.py index e3705a37cd..c87ddac583 100644 --- a/manila/tests/api/v2/test_share_group_types.py +++ b/manila/tests/api/v2/test_share_group_types.py @@ -652,7 +652,7 @@ class ShareGroupTypeAccessTest(test.TestCase): def test_add_project_access_to_public_share_type(self): self.mock_object( - share_group_types, 'get', mock.Mock(return_value=GROUP_TYPE_1)) + share_group_types, 'get', mock.Mock(return_value=GROUP_TYPE_1)) body = {'addProjectAccess': {'project': PROJ1_UUID}} req = fake_request( '/v2/fake/share-group-types/%s' % GROUP_TYPE_1['id'], admin=True) diff --git a/manila/tests/db/sqlalchemy/test_api.py b/manila/tests/db/sqlalchemy/test_api.py index 093688232b..8568a7adb2 100644 --- a/manila/tests/db/sqlalchemy/test_api.py +++ b/manila/tests/db/sqlalchemy/test_api.py @@ -1337,7 +1337,7 @@ class ShareSnapshotDatabaseAPITestCase(test.TestCase): expected_number = 1 if status else 3 filters = { 'snapshot_ids': 'fake_snapshot_id_1', - 'statuses': expected_status + 'statuses': expected_status } instances = db_api.share_snapshot_instance_get_all_with_filters( self.ctxt, filters) @@ -3451,7 +3451,7 @@ class ShareTypeAPITestCase(test.TestCase): # Validate that quotas exist share_type_quotas = db_api.quota_get_all_by_project_and_share_type( - self.ctxt, 'fake-project-id', share_type['id']) + self.ctxt, 'fake-project-id', share_type['id']) expected_quotas = { 'project_id': 'fake-project-id', 'share_type_id': share_type['id'], diff --git a/manila/tests/share/drivers/dummy.py b/manila/tests/share/drivers/dummy.py index 28458f5b5f..52f7999c96 100644 --- a/manila/tests/share/drivers/dummy.py +++ b/manila/tests/share/drivers/dummy.py @@ -696,7 +696,7 @@ class DummyDriver(driver.ShareDriver): gathered_at = timeutils.utcnow() for s in shares: share_updates.append({'id': s['id'], - 'used_size': 1, + 'used_size': 1, 'gathered_at': gathered_at}) return share_updates diff --git a/manila/tests/share/drivers/huawei/test_huawei_nas.py b/manila/tests/share/drivers/huawei/test_huawei_nas.py index 87729247a2..223f5e6516 100644 --- a/manila/tests/share/drivers/huawei/test_huawei_nas.py +++ b/manila/tests/share/drivers/huawei/test_huawei_nas.py @@ -3437,7 +3437,7 @@ class HuaweiShareDriverTestCase(test.TestCase): self.assertEqual(self.fake_network_allocations[0]['ip_address'], backend_details['ip']) self.driver.plugin._get_online_port.assert_called_once_with( - ['CTE0.A.H0', 'CTE0.A.H2', 'CTE0.B.H0', 'BOND0']) + ['CTE0.A.H0', 'CTE0.A.H2', 'CTE0.B.H0', 'BOND0']) self.assertTrue(self.driver.plugin.helper.get_all_logical_port.called) self.driver.plugin.helper.get_port_id.assert_called_once_with( 'CTE0.A.H2', constants.PORT_TYPE_ETH) @@ -3884,11 +3884,11 @@ class HuaweiShareDriverTestCase(test.TestCase): self.share_server) def _add_conf_file_element(self, doc, parent_element, name, value=None): - new_element = doc.createElement(name) - if value: - new_text = doc.createTextNode(value) - new_element.appendChild(new_text) - parent_element.appendChild(new_element) + new_element = doc.createElement(name) + if value: + new_text = doc.createTextNode(value) + new_element.appendChild(new_text) + parent_element.appendChild(new_element) def create_fake_conf_file(self, fake_conf_file, product_flag=True, username_flag=True, diff --git a/manila/tests/share/drivers/netapp/dataontap/cluster_mode/test_lib_base.py b/manila/tests/share/drivers/netapp/dataontap/cluster_mode/test_lib_base.py index 0ec2b0a55f..2156e45d01 100644 --- a/manila/tests/share/drivers/netapp/dataontap/cluster_mode/test_lib_base.py +++ b/manila/tests/share/drivers/netapp/dataontap/cluster_mode/test_lib_base.py @@ -1436,7 +1436,7 @@ class NetAppFileStorageLibraryTestCase(test.TestCase): share_name = self.library._get_backend_share_name( fake_snapshot['share_id']) vserver_client.delete_snapshot.assert_called_once_with( - share_name, fake_snapshot['provider_location']) + share_name, fake_snapshot['provider_location']) @ddt.data(exception.InvalidInput(reason='fake_reason'), exception.VserverNotSpecified(), diff --git a/manila/tests/share/test_api.py b/manila/tests/share/test_api.py index 981bb6bc34..dc90db4a0b 100644 --- a/manila/tests/share/test_api.py +++ b/manila/tests/share/test_api.py @@ -3726,7 +3726,7 @@ class ShareAPITestCase(test.TestCase): self.context, replica['id'], {'status': constants.STATUS_DELETING, 'terminated_at': mock.ANY}) mock_snapshot_get_call.assert_called_once_with( - self.context, {'share_instance_ids': replica['id']}) + self.context, {'share_instance_ids': replica['id']}) self.assertEqual( len(snapshots), mock_snapshot_instance_delete_call.call_count) diff --git a/manila/tests/share/test_manager.py b/manila/tests/share/test_manager.py index bdddc92670..f738366ee5 100644 --- a/manila/tests/share/test_manager.py +++ b/manila/tests/share/test_manager.py @@ -1563,7 +1563,7 @@ class ShareManagerTestCase(test.TestCase): self.share_manager.db, 'share_replica_update') self.share_manager._share_replica_update( - self.context, replica, share_id=replica['share_id']) + self.context, replica, share_id=replica['share_id']) mock_db_update_call.assert_called_once_with( self.context, replica['id'], @@ -1688,7 +1688,7 @@ class ShareManagerTestCase(test.TestCase): self.context, replica, share_id=replica['share_id']) if retval == constants.REPLICA_STATE_ACTIVE: - self.assertEqual(1, mock_warning_log.call_count) + self.assertEqual(1, mock_warning_log.call_count) elif retval: self.assertEqual(0, mock_warning_log.call_count) self.assertTrue(mock_driver_call.called) diff --git a/manila/tests/share/test_migration.py b/manila/tests/share/test_migration.py index 3add62302d..8caa93f980 100644 --- a/manila/tests/share/test_migration.py +++ b/manila/tests/share/test_migration.py @@ -207,7 +207,7 @@ class ShareMigrationHelperTestCase(test.TestCase): # run self.assertRaises( exception.ShareMigrationFailed, - self.helper.create_instance_and_wait, self.share, + self.helper.create_instance_and_wait, self.share, host, 'fake_net_id', 'fake_az_id', 'fake_type_id') # asserts diff --git a/tox.ini b/tox.ini index ff39aad5b8..48cb934d32 100644 --- a/tox.ini +++ b/tox.ini @@ -136,11 +136,10 @@ commands = alembic -c manila/db/migrations/alembic.ini revision -m ""{posargs} # W605 invalid escape sequence # E741 ambiguous variable name 'l' # E305 expected 2 blank lines after class or function definition, found 1 -# E241 multiple spaces after ':' # E731 do not assign a lambda expression, use a def # E117 over-indented # E226 missing whitespace around arithmetic operator -ignore = E117,E123,E226,E241,E305,E402,E731,E741,W503,W504,W605 +ignore = E117,E123,E226,E305,E402,E731,E741,W503,W504,W605 builtins = _ # [H106] Don't put vim configuration in source files. # [H203] Use assertIs(Not)None to check for None.