From e6321ef3c3a593b13de85cb20194632312576ce5 Mon Sep 17 00:00:00 2001 From: Zhongyue Luo Date: Mon, 17 Sep 2012 16:45:50 +0800 Subject: [PATCH] Clean up pep8 E502 violations Updated pep8 version requirement to 1.3.3 Fixed E502 errors All ignores are to be removed in the next sequence of patches Change-Id: I71c013061fb88d7b8b31cfa3b83498999455d8db --- tempest/tests/compute/test_authorization.py | 26 +++++++++---------- .../compute/test_floating_ips_actions.py | 4 +-- tools/test-requires | 2 +- tox.ini | 4 +-- 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/tempest/tests/compute/test_authorization.py b/tempest/tests/compute/test_authorization.py index afa60b3438..b725b828f6 100644 --- a/tempest/tests/compute/test_authorization.py +++ b/tempest/tests/compute/test_authorization.py @@ -86,7 +86,7 @@ class AuthorizationTest(BaseComputeTest): from_port = 22 to_port = 22 resp, cls.rule =\ - cls.security_client.create_security_group_rule(\ + cls.security_client.create_security_group_rule( parent_group_id, ip_protocol, from_port, to_port) @@ -263,7 +263,7 @@ class AuthorizationTest(BaseComputeTest): self.alt_security_client.base_url = self.security_client.base_url resp = {} resp['status'] = None - resp, body = self.alt_security_client.create_security_group(\ + resp, body = self.alt_security_client.create_security_group( s_name, s_description) finally: @@ -279,14 +279,13 @@ class AuthorizationTest(BaseComputeTest): @attr(type='negative') def test_get_security_group_of_alt_account_fails(self): """A GET request for another user's security group should fail""" - self.alt_security_client.get_security_group(\ - self.security_group['id']) + self.alt_security_client.get_security_group(self.security_group['id']) @raises(exceptions.NotFound) @attr(type='negative') def test_delete_security_group_of_alt_account_fails(self): """A DELETE request for another user's security group should fail""" - self.alt_security_client.delete_security_group(\ + self.alt_security_client.delete_security_group( self.security_group['id']) @raises(exceptions.BadRequest) @@ -308,7 +307,7 @@ class AuthorizationTest(BaseComputeTest): resp = {} resp['status'] = None resp, body = \ - self.alt_security_client.create_security_group_rule(\ + self.alt_security_client.create_security_group_rule( parent_group_id, ip_protocol, from_port, to_port) @@ -317,7 +316,7 @@ class AuthorizationTest(BaseComputeTest): self.alt_security_client.base_url = self.saved_base_url if resp['status'] != None: resp, _ = \ - self.alt_security_client.delete_security_group_rule(\ + self.alt_security_client.delete_security_group_rule( body['id']) self.fail("Create security group rule request should not " "happen if the tenant id does not match the" @@ -331,8 +330,7 @@ class AuthorizationTest(BaseComputeTest): A DELETE request for another user's security group rule should fail """ - self.alt_security_client.delete_security_group_rule(\ - self.rule['id']) + self.alt_security_client.delete_security_group_rule(self.rule['id']) @raises(exceptions.NotFound) @attr(type='negative') @@ -379,7 +377,7 @@ class AuthorizationTest(BaseComputeTest): except exceptions.NotFound: pass finally: - resp, body = self.images_client.delete_image_metadata_item(\ + resp, body = self.images_client.delete_image_metadata_item( self.image['id'], 'meta1') @attr(type='negative') @@ -390,8 +388,8 @@ class AuthorizationTest(BaseComputeTest): req_metadata) try: resp, body = \ - self.alt_client.delete_server_metadata_item(\ - self.server['id'], 'meta1') + self.alt_client.delete_server_metadata_item(self.server['id'], + 'meta1') except exceptions.NotFound: pass finally: @@ -406,8 +404,8 @@ class AuthorizationTest(BaseComputeTest): req_metadata) try: resp, body = \ - self.alt_images_client.delete_image_metadata_item(\ - self.image['id'], 'meta1') + self.alt_images_client.delete_image_metadata_item(self.image['id'], + 'meta1') except exceptions.NotFound: pass finally: diff --git a/tempest/tests/compute/test_floating_ips_actions.py b/tempest/tests/compute/test_floating_ips_actions.py index 2f7532bb27..90d5e3509f 100644 --- a/tempest/tests/compute/test_floating_ips_actions.py +++ b/tempest/tests/compute/test_floating_ips_actions.py @@ -187,7 +187,7 @@ class FloatingIPsTestBase(object): #Make sure no longer associated with old server try: - self.client.disassociate_floating_ip_from_server(\ + self.client.disassociate_floating_ip_from_server( self.floating_ip, self.server_id) except exceptions.NotFound: @@ -198,7 +198,7 @@ class FloatingIPsTestBase(object): if (resp['status'] != None): #Dissociation of the floating IP associated in this method resp, _ = \ - self.client.disassociate_floating_ip_from_server(\ + self.client.disassociate_floating_ip_from_server( self.floating_ip, self.new_server_id) #Deletion of server created in this method diff --git a/tools/test-requires b/tools/test-requires index ecf7c3e2bc..fa98918461 100644 --- a/tools/test-requires +++ b/tools/test-requires @@ -1,4 +1,4 @@ -pep8>=0.5.0 +pep8==1.3.3 pylint==0.19 # Needed for whitebox testing paramiko diff --git a/tox.ini b/tox.ini index c260fd86ad..5f957a1245 100644 --- a/tox.ini +++ b/tox.ini @@ -14,5 +14,5 @@ deps = -r{toxinidir}/tools/pip-requires commands = nosetests {posargs} [testenv:pep8] -deps = pep8==1.1 -commands = pep8 --repeat --show-source --exclude=.venv,.tox,dist,doc,openstack,kong . +deps = pep8==1.3.3 +commands = pep8 --ignore=E121,E122,E123,E124,E125,E126,E127,E128,E711 --repeat --show-source --exclude=.venv,.tox,dist,doc,openstack,kong .