From 7fc1588dfda6edcb68aee2ff40e7475f9a6e400b Mon Sep 17 00:00:00 2001 From: Andrey Kurilin Date: Wed, 24 Sep 2014 22:10:34 +0300 Subject: [PATCH] Enable check for E121 E121 continuation line under-indented for hanging indent Change-Id: I4cf246e3ec932ba0d2391eb8bcb793b28b005b4c --- novaclient/tests/fixture_data/certs.py | 2 +- novaclient/tests/fixture_data/floatingips.py | 2 +- novaclient/tests/test_shell.py | 13 +++---- novaclient/tests/v1_1/fakes.py | 38 ++++++++++---------- novaclient/tests/v1_1/test_hypervisors.py | 8 ++--- novaclient/v1_1/servers.py | 4 +-- novaclient/v3/servers.py | 4 +-- tox.ini | 5 +-- 8 files changed, 39 insertions(+), 37 deletions(-) diff --git a/novaclient/tests/fixture_data/certs.py b/novaclient/tests/fixture_data/certs.py index 40421ca1b..243bb0ea7 100644 --- a/novaclient/tests/fixture_data/certs.py +++ b/novaclient/tests/fixture_data/certs.py @@ -48,7 +48,7 @@ class Fixture(base.Fixture): 'certificate': { 'private_key': 'foo', 'data': 'bar' - } + } } self.requests.register_uri('POST', self.url(), json=post_os_certificates, diff --git a/novaclient/tests/fixture_data/floatingips.py b/novaclient/tests/fixture_data/floatingips.py index d73546fb7..3f2b25000 100644 --- a/novaclient/tests/fixture_data/floatingips.py +++ b/novaclient/tests/fixture_data/floatingips.py @@ -109,7 +109,7 @@ class DNSFixture(base.Fixture): 'name': "host1", 'type': "A", 'domain': 'testdomain' - } + } }, { 'dns_entry': { diff --git a/novaclient/tests/test_shell.py b/novaclient/tests/test_shell.py index 240965d79..8fae05657 100644 --- a/novaclient/tests/test_shell.py +++ b/novaclient/tests/test_shell.py @@ -204,12 +204,13 @@ class ShellTest(utils.TestCase): dist_version.StrictVersion('0.7.2')): ex = '\n' else: - ex = ( - '+----+------+--------+------------+-------------+----------+\n' - '| ID | Name | Status | Task State | Power State | Networks |\n' - '+----+------+--------+------------+-------------+----------+\n' - '+----+------+--------+------------+-------------+----------+\n' - ) + ex = '\n'.join([ + '+----+------+--------+------------+-------------+----------+', + '| ID | Name | Status | Task State | Power State | Networks |', + '+----+------+--------+------------+-------------+----------+', + '+----+------+--------+------------+-------------+----------+', + '' + ]) self.make_env(exclude='OS_PASSWORD') stdout, stderr = self.shell('list') self.assertEqual((stdout + stderr), ex) diff --git a/novaclient/tests/v1_1/fakes.py b/novaclient/tests/v1_1/fakes.py index 3e82eb053..4267df4e2 100644 --- a/novaclient/tests/v1_1/fakes.py +++ b/novaclient/tests/v1_1/fakes.py @@ -1989,8 +1989,8 @@ class FakeHTTPClient(base_client.HTTPClient): "attached": "2011-11-11T00:00:00Z", "size": 1024, "attachments": [ - {"id": "3333", - "links": ''}], + {"id": "3333", + "links": ''}], "metadata": {}}]}) def get_servers_1234_os_volume_attachments_Work(self, **kw): @@ -2003,8 +2003,8 @@ class FakeHTTPClient(base_client.HTTPClient): "attached": "2011-11-11T00:00:00Z", "size": 1024, "attachments": [ - {"id": "3333", - "links": ''}], + {"id": "3333", + "links": ''}], "metadata": {}}}) def delete_servers_1234_os_volume_attachments_Work(self, **kw): @@ -2072,21 +2072,21 @@ class FakeHTTPClient(base_client.HTTPClient): return self.get_os_cells_capacities() def get_os_migrations(self, **kw): - migrations = {'migrations': - [{ - "created_at": "2012-10-29T13:42:02.000000", - "dest_compute": "compute2", - "dest_host": "1.2.3.4", - "dest_node": "node2", - "id": 1234, - "instance_uuid": "instance_id_123", - "new_instance_type_id": 2, - "old_instance_type_id": 1, - "source_compute": "compute1", - "source_node": "node1", - "status": "Done", - "updated_at": "2012-10-29T13:42:02.000000" - }]} + migrations = {'migrations': [ + { + "created_at": "2012-10-29T13:42:02.000000", + "dest_compute": "compute2", + "dest_host": "1.2.3.4", + "dest_node": "node2", + "id": 1234, + "instance_uuid": "instance_id_123", + "new_instance_type_id": 2, + "old_instance_type_id": 1, + "source_compute": "compute1", + "source_node": "node1", + "status": "Done", + "updated_at": "2012-10-29T13:42:02.000000" + }]} return (200, {}, migrations) def post_os_server_external_events(self, **kw): diff --git a/novaclient/tests/v1_1/test_hypervisors.py b/novaclient/tests/v1_1/test_hypervisors.py index 8376d61f5..a1b404f0b 100644 --- a/novaclient/tests/v1_1/test_hypervisors.py +++ b/novaclient/tests/v1_1/test_hypervisors.py @@ -99,13 +99,13 @@ class HypervisorsTest(utils.FixturedTestCase): dict(id=1234, hypervisor_hostname='hyper1', servers=[ - dict(name='inst1', uuid='uuid1'), - dict(name='inst2', uuid='uuid2')]), + dict(name='inst1', uuid='uuid1'), + dict(name='inst2', uuid='uuid2')]), dict(id=5678, hypervisor_hostname='hyper2', servers=[ - dict(name='inst3', uuid='uuid3'), - dict(name='inst4', uuid='uuid4')]), + dict(name='inst3', uuid='uuid3'), + dict(name='inst4', uuid='uuid4')]), ] result = self.cs.hypervisors.search('hyper', True) diff --git a/novaclient/v1_1/servers.py b/novaclient/v1_1/servers.py index 38bde8c62..ec6682054 100644 --- a/novaclient/v1_1/servers.py +++ b/novaclient/v1_1/servers.py @@ -486,8 +486,8 @@ class ServerManager(base.BootingManagerWithFind): body["server"]["max_count"] = max_count if security_groups: - body["server"]["security_groups"] =\ - [{'name': sg} for sg in security_groups] + body["server"]["security_groups"] = [{'name': sg} + for sg in security_groups] # Files are a slight bit tricky. They're passed in a "personality" # list to the POST. Each item is a dict giving a file name and the diff --git a/novaclient/v3/servers.py b/novaclient/v3/servers.py index 70bc5a54b..c9324c477 100644 --- a/novaclient/v3/servers.py +++ b/novaclient/v3/servers.py @@ -428,8 +428,8 @@ class ServerManager(base.BootingManagerWithFind): body["server"]["os-multiple-create:max_count"] = max_count if security_groups: - body["server"]["security_groups"] = \ - [{'name': sg} for sg in security_groups] + body["server"]["security_groups"] = [{'name': sg} + for sg in security_groups] if availability_zone: body["server"][ diff --git a/tox.ini b/tox.ini index 53fa8719f..34f30deed 100644 --- a/tox.ini +++ b/tox.ini @@ -41,8 +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: E12, F811, F821 -ignore = E12,F811,F821,H402,H404,H405,H904 +# Additional checks are also ignored on purpose: E122, E123, E124, E126, +# E127, E128, E129, F811, F821 +ignore = E122,E123,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