diff --git a/novaclient/tests/fixture_data/servers.py b/novaclient/tests/fixture_data/servers.py index 1594ad0a0..00b7cd9fb 100644 --- a/novaclient/tests/fixture_data/servers.py +++ b/novaclient/tests/fixture_data/servers.py @@ -562,7 +562,7 @@ class V3(Base): 'rescue': {'admin_password': 'RescuePassword'}, 'get_console_output': {'output': 'foo'}, 'rebuild': {'server': self.server_1234}, - } + } body_param_check_exists = { 'rebuild': 'image_ref', 'resize': 'flavor_ref'} diff --git a/novaclient/tests/test_client.py b/novaclient/tests/test_client.py index f8bcaed80..16d62a5b9 100644 --- a/novaclient/tests/test_client.py +++ b/novaclient/tests/test_client.py @@ -91,7 +91,7 @@ class ClientTest(utils.TestCase): "passwordCredentials": { "username": "user", "password": "password" - } + } } } diff --git a/novaclient/tests/v1_1/contrib/test_baremetal.py b/novaclient/tests/v1_1/contrib/test_baremetal.py index 6a88d580c..172d8b272 100644 --- a/novaclient/tests/v1_1/contrib/test_baremetal.py +++ b/novaclient/tests/v1_1/contrib/test_baremetal.py @@ -22,7 +22,7 @@ from novaclient.v1_1.contrib import baremetal extensions = [ extension.Extension(baremetal.__name__.split(".")[-1], baremetal), - ] +] cs = fakes.FakeClient(extensions=extensions) diff --git a/novaclient/tests/v1_1/fakes.py b/novaclient/tests/v1_1/fakes.py index 921d72af1..929ad2082 100644 --- a/novaclient/tests/v1_1/fakes.py +++ b/novaclient/tests/v1_1/fakes.py @@ -1285,8 +1285,7 @@ class FakeHTTPClient(base_client.HTTPClient): "tenant_id": "272bee4c1e624cd4a72a6b0ea55b4582", "id": 2, "rules": []} - ]} - ) + ]}) def get_os_security_groups_1(self, **kw): return (200, {}, {"security_group": @@ -1649,8 +1648,7 @@ class FakeHTTPClient(base_client.HTTPClient): def get_os_hypervisors(self, **kw): return (200, {}, {"hypervisors": [ {'id': 1234, 'hypervisor_hostname': 'hyper1'}, - {'id': 5678, 'hypervisor_hostname': 'hyper2'}, - ]}) + {'id': 5678, 'hypervisor_hostname': 'hyper2'}]}) def get_os_hypervisors_detail(self, **kw): return (200, {}, {"hypervisors": [ @@ -1688,7 +1686,7 @@ class FakeHTTPClient(base_client.HTTPClient): 'running_vms': 2, 'cpu_info': 'cpu_info', 'disk_available_least': 100} - ]}) + ]}) def get_os_hypervisors_statistics(self, **kw): return (200, {}, {"hypervisor_statistics": { @@ -1704,13 +1702,12 @@ class FakeHTTPClient(base_client.HTTPClient): 'current_workload': 4, 'running_vms': 4, 'disk_available_least': 200, - }}) + }}) def get_os_hypervisors_hyper_search(self, **kw): return (200, {}, {'hypervisors': [ {'id': 1234, 'hypervisor_hostname': 'hyper1'}, - {'id': 5678, 'hypervisor_hostname': 'hyper2'} - ]}) + {'id': 5678, 'hypervisor_hostname': 'hyper2'}]}) def get_os_hypervisors_hyper_servers(self, **kw): return (200, {}, {'hypervisors': [ @@ -1718,15 +1715,13 @@ class FakeHTTPClient(base_client.HTTPClient): 'hypervisor_hostname': 'hyper1', 'servers': [ {'name': 'inst1', 'uuid': 'uuid1'}, - {'name': 'inst2', 'uuid': 'uuid2'} - ]}, + {'name': 'inst2', 'uuid': 'uuid2'}]}, {'id': 5678, 'hypervisor_hostname': 'hyper2', 'servers': [ {'name': 'inst3', 'uuid': 'uuid3'}, - {'name': 'inst4', 'uuid': 'uuid4'} - ]} - ]}) + {'name': 'inst4', 'uuid': 'uuid4'}]} + ]}) def get_os_hypervisors_hyper_no_servers_servers(self, **kw): return (200, {}, {'hypervisors': @@ -2051,12 +2046,11 @@ class FakeHTTPClient(base_client.HTTPClient): 'rpc_host': '10.0.1.10', 'type': 'child', 'name': 'cell1', - 'rpc_port': 5673 - }, + 'rpc_port': 5673}, 'type': 'child', 'rpc_port': 5673, 'loaded': True - }} + }} return (200, {}, cell) def get_os_cells_capacities(self, **kw): diff --git a/novaclient/tests/v1_1/test_hypervisors.py b/novaclient/tests/v1_1/test_hypervisors.py index a1b404f0b..94bbb0838 100644 --- a/novaclient/tests/v1_1/test_hypervisors.py +++ b/novaclient/tests/v1_1/test_hypervisors.py @@ -30,8 +30,7 @@ class HypervisorsTest(utils.FixturedTestCase): def test_hypervisor_index(self): expected = [ dict(id=1234, hypervisor_hostname='hyper1'), - dict(id=5678, hypervisor_hostname='hyper2'), - ] + dict(id=5678, hypervisor_hostname='hyper2')] result = self.cs.hypervisors.list(False) self.assert_called('GET', '/os-hypervisors') @@ -85,8 +84,7 @@ class HypervisorsTest(utils.FixturedTestCase): def test_hypervisor_search(self): expected = [ dict(id=1234, hypervisor_hostname='hyper1'), - dict(id=5678, hypervisor_hostname='hyper2'), - ] + dict(id=5678, hypervisor_hostname='hyper2')] result = self.cs.hypervisors.search('hyper') self.assert_called('GET', '/os-hypervisors/hyper/search') @@ -106,7 +104,7 @@ class HypervisorsTest(utils.FixturedTestCase): servers=[ dict(name='inst3', uuid='uuid3'), dict(name='inst4', uuid='uuid4')]), - ] + ] result = self.cs.hypervisors.search('hyper', True) self.assert_called('GET', '/os-hypervisors/hyper/servers') @@ -164,7 +162,7 @@ class HypervisorsTest(utils.FixturedTestCase): current_workload=4, running_vms=4, disk_available_least=200, - ) + ) result = self.cs.hypervisors.statistics() self.assert_called('GET', '/os-hypervisors/statistics') diff --git a/novaclient/tests/v1_1/test_servers.py b/novaclient/tests/v1_1/test_servers.py index 9bd7fddea..0a81c5aae 100644 --- a/novaclient/tests/v1_1/test_servers.py +++ b/novaclient/tests/v1_1/test_servers.py @@ -640,11 +640,12 @@ class ServersTest(utils.FixturedTestCase): 'port_id': 'f35079da-36d5-4513-8ec1-0298d703f70e', 'mac_addr': 'fa:16:3e:4c:37:c8', 'port_state': 'ACTIVE', - 'fixed_ips': [{ - 'subnet_id': 'f1ad93ad-2967-46ba-b403-e8cbbe65f7fa', - 'ip_address': '10.2.0.96' + 'fixed_ips': [ + { + 'subnet_id': 'f1ad93ad-2967-46ba-b403-e8cbbe65f7fa', + 'ip_address': '10.2.0.96' }] - }] + }] # If server is not string representable, it will raise an exception, # because attribute named 'name' cannot be found. # Parameter 'loaded' must be True or it will try to get attribute diff --git a/novaclient/tests/v3/fakes.py b/novaclient/tests/v3/fakes.py index 18989a253..5e6f370dc 100644 --- a/novaclient/tests/v3/fakes.py +++ b/novaclient/tests/v3/fakes.py @@ -195,7 +195,7 @@ class FakeHTTPClient(fakes_v1_1.FakeHTTPClient): 'rescue': {'admin_password': 'RescuePassword'}, 'get_console_output': {'output': 'foo'}, 'rebuild': self.get_servers_1234()[2], - } + } body_param_check_exists = { 'rebuild': 'image_ref', 'resize': 'flavor_ref', @@ -336,12 +336,10 @@ class FakeHTTPClient(fakes_v1_1.FakeHTTPClient): def get_os_hypervisors_search(self, **kw): if kw['query'] == 'hyper1': return (200, {}, {'hypervisors': [ - {'id': 1234, 'hypervisor_hostname': 'hyper1'}, - ]}) + {'id': 1234, 'hypervisor_hostname': 'hyper1'}]}) return (200, {}, {'hypervisors': [ {'id': 1234, 'hypervisor_hostname': 'hyper1'}, - {'id': 5678, 'hypervisor_hostname': 'hyper2'} - ]}) + {'id': 5678, 'hypervisor_hostname': 'hyper2'}]}) def get_os_hypervisors_1234_servers(self, **kw): return (200, {}, {'hypervisor': @@ -349,9 +347,7 @@ class FakeHTTPClient(fakes_v1_1.FakeHTTPClient): 'hypervisor_hostname': 'hyper1', 'servers': [ {'name': 'inst1', 'id': 'uuid1'}, - {'name': 'inst2', 'id': 'uuid2'} - ]}, - }) + {'name': 'inst2', 'id': 'uuid2'}]}}) # # Keypairs diff --git a/novaclient/tests/v3/test_hypervisors.py b/novaclient/tests/v3/test_hypervisors.py index ee7c83fcb..94ea3fad4 100644 --- a/novaclient/tests/v3/test_hypervisors.py +++ b/novaclient/tests/v3/test_hypervisors.py @@ -26,8 +26,7 @@ class HypervisorsTest(test_hypervisors.HypervisorsTest): def test_hypervisor_search(self): expected = [ dict(id=1234, hypervisor_hostname='hyper1'), - dict(id=5678, hypervisor_hostname='hyper2'), - ] + dict(id=5678, hypervisor_hostname='hyper2')] result = self.cs.hypervisors.search('hyper') self.assert_called('GET', '/os-hypervisors/search?query=hyper') diff --git a/novaclient/v1_1/contrib/baremetal.py b/novaclient/v1_1/contrib/baremetal.py index d13018ce8..82803184a 100644 --- a/novaclient/v1_1/contrib/baremetal.py +++ b/novaclient/v1_1/contrib/baremetal.py @@ -243,7 +243,7 @@ def _print_baremetal_nodes_list(nodes): 'PM Username', 'PM Password', 'Terminal Port', - ], formatters=formatters) + ], formatters=formatters) def do_baremetal_node_list(cs, _args): @@ -270,7 +270,7 @@ def _print_baremetal_node_interfaces(interfaces): 'Datapath_ID', 'Port_No', 'Address', - ]) + ]) @utils.arg('node', diff --git a/tox.ini b/tox.ini index ca21ce589..b38ae1c4a 100644 --- a/tox.ini +++ b/tox.ini @@ -41,9 +41,9 @@ downloadcache = ~/cache/pip # H904 wrap long lines in parentheses instead of a backslash # reason: removed in hacking (https://review.openstack.org/#/c/101701/) # -# Additional checks are also ignored on purpose: E123, E124, E126, +# Additional checks are also ignored on purpose: E124, E126, # E127, E128, E129, F811, F821 -ignore = E123,E124,E126,E127,E128,E129,F811,F821,H402,H404,H405,H904 +ignore = E124,E126,E127,E128,E129,F811,F821,H402,H404,H405,H904 show-source = True exclude=.venv,.git,.tox,dist,*openstack/common*,*lib/python*,*egg,build,doc/source/conf.py