Hacking: Fix E241

Fix:
E241 multiple spaces after ':' (or ',')

Fix also a few other problems found by hacking in files changed.

Change-Id: I4c00551f29ad65df2631c8ae55fe2f022e872544
This commit is contained in:
Andreas Jaeger 2020-04-01 09:07:49 +02:00
parent 8730b1638b
commit 28bb650128
14 changed files with 22 additions and 23 deletions

View File

@ -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:

View File

@ -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)

View File

@ -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',

View File

@ -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

View File

@ -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'

View File

@ -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)

View File

@ -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'],

View File

@ -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

View File

@ -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,

View File

@ -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(),

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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.