Browse Source

Hacking: Fix E241

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

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

Change-Id: I4c00551f29ad65df2631c8ae55fe2f022e872544
changes/12/716512/2
Andreas Jaeger 1 year ago
parent
commit
28bb650128
  1. 2
      manila/api/v2/share_group_types.py
  2. 4
      manila/network/neutron/neutron_network_plugin.py
  3. 2
      manila/share/drivers/inspur/instorage/instorage.py
  4. 2
      manila/share_group/api.py
  5. 2
      manila/tests/api/v2/test_share_group_snapshots.py
  6. 2
      manila/tests/api/v2/test_share_group_types.py
  7. 4
      manila/tests/db/sqlalchemy/test_api.py
  8. 2
      manila/tests/share/drivers/dummy.py
  9. 12
      manila/tests/share/drivers/huawei/test_huawei_nas.py
  10. 2
      manila/tests/share/drivers/netapp/dataontap/cluster_mode/test_lib_base.py
  11. 2
      manila/tests/share/test_api.py
  12. 4
      manila/tests/share/test_manager.py
  13. 2
      manila/tests/share/test_migration.py
  14. 3
      tox.ini

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

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

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

2
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

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

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

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

2
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

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

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

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

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

2
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

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

Loading…
Cancel
Save