Enable E251,E265 rules ignore H402

After bumping the hacking version to the 0.9.x series ignores were
added for several rules. This commit fixes the violations for a subset
of these rules and re-enables the checks.

Change-Id: If2445c395d481f3c5f6426a471da4ec8afb553f0
This commit is contained in:
Matthew Treinish 2014-06-09 17:13:48 -04:00
parent 8446493234
commit 571605828b
13 changed files with 36 additions and 35 deletions

@ -143,4 +143,4 @@ class ClusterTemplateTest(dp_base.BaseDataProcessingTest):
# delete the cluster template by id
resp = self.client.delete_cluster_template(template_id)[0]
self.assertEqual(204, resp.status)
#TODO(ylobankov): check that cluster template is really deleted
# TODO(ylobankov): check that cluster template is really deleted

@ -171,13 +171,13 @@ class ProjectsTestJSON(base.BaseIdentityV3AdminTest):
@test.attr(type='gate')
def test_associate_user_to_project(self):
#Associate a user to a project
#Create a Project
# Associate a user to a project
# Create a Project
p_name = data_utils.rand_name('project-')
resp, project = self.client.create_project(p_name)
self.data.projects.append(project)
#Create a User
# Create a User
u_name = data_utils.rand_name('user-')
u_desc = u_name + 'description'
u_email = u_name + '@testmail.tm'
@ -191,7 +191,7 @@ class ProjectsTestJSON(base.BaseIdentityV3AdminTest):
# Get User To validate the user details
resp, new_user_get = self.client.get_user(user['id'])
#Assert response body of GET
# Assert response body of GET
self.assertEqual(u_name, new_user_get['name'])
self.assertEqual(u_desc, new_user_get['description'])
self.assertEqual(project['id'],

@ -55,7 +55,7 @@ class NegativeSecGroupTest(base.BaseSecGroupTest):
def test_create_security_group_rule_with_bad_protocol(self):
group_create_body, _ = self._create_security_group()
#Create rule with bad protocol name
# Create rule with bad protocol name
pname = 'bad_protocol_name'
self.assertRaises(
exceptions.BadRequest, self.client.create_security_group_rule,
@ -66,7 +66,7 @@ class NegativeSecGroupTest(base.BaseSecGroupTest):
def test_create_security_group_rule_with_invalid_ports(self):
group_create_body, _ = self._create_security_group()
#Create rule with invalid ports
# Create rule with invalid ports
states = [(-16, 80, 'Invalid value for port -16'),
(80, 79, 'port_range_min must be <= port_range_max'),
(80, 65536, 'Invalid value for port 65536'),

@ -68,13 +68,13 @@ class NovaKeyPairResourcesYAMLTest(base.BaseOrchestrationTest):
output_map = {}
for outputs in stack['outputs']:
output_map[outputs['output_key']] = outputs['output_value']
#Test that first key generated public and private keys
# Test that first key generated public and private keys
self.assertTrue('KeyPair_PublicKey' in output_map)
self.assertTrue("Generated" in output_map['KeyPair_PublicKey'])
self.assertTrue('KeyPair_PrivateKey' in output_map)
self.assertTrue('-----BEGIN' in output_map['KeyPair_PrivateKey'])
#Test that second key generated public key, and private key is not
#in the output due to save_private_key = false
# Test that second key generated public key, and private key is not
# in the output due to save_private_key = false
self.assertTrue('KeyPairDontSavePrivate_PublicKey' in output_map)
self.assertTrue('Generated' in
output_map['KeyPairDontSavePrivate_PublicKey'])

@ -29,9 +29,9 @@ class ExtraSpecsNegativeTest(base.BaseVolumeV1AdminTest):
super(ExtraSpecsNegativeTest, cls).setUpClass()
vol_type_name = data_utils.rand_name('Volume-type-')
cls.extra_specs = {"spec1": "val1"}
resp, cls.volume_type = cls.client.create_volume_type(vol_type_name,
extra_specs=
cls.extra_specs)
resp, cls.volume_type = cls.client.create_volume_type(
vol_type_name,
extra_specs=cls.extra_specs)
@classmethod
def tearDownClass(cls):

@ -39,7 +39,7 @@ class VolumesGetTest(base.BaseVolumeV1Test):
def _is_true(self, val):
# NOTE(jdg): Temporary conversion method to get cinder patch
# merged. Then we'll make this strict again and
#specifically check "true" or "false"
# specifically check "true" or "false"
if val in ['true', 'True', True]:
return True
else:
@ -121,19 +121,19 @@ class VolumesGetTest(base.BaseVolumeV1Test):
new_volume = {}
new_v_desc = data_utils.rand_name('@#$%^* description')
resp, new_volume = \
self.client.create_volume(size=1,
display_description=new_v_desc,
availability_zone=
volume['availability_zone'])
self.client.create_volume(
size=1,
display_description=new_v_desc,
availability_zone=volume['availability_zone'])
self.assertEqual(200, resp.status)
self.assertIn('id', new_volume)
self.addCleanup(self._delete_volume, new_volume['id'])
self.client.wait_for_volume_status(new_volume['id'], 'available')
resp, update_volume = \
self.client.update_volume(new_volume['id'],
display_name=volume['display_name'],
display_description=
volume['display_description'])
self.client.update_volume(
new_volume['id'],
display_name=volume['display_name'],
display_description=volume['display_description'])
self.assertEqual(200, resp.status)
# NOTE(jdg): Revert back to strict true/false checking

@ -38,7 +38,7 @@ class NetworkClientXML(client_base.NetworkClientBase):
return _root_tag_fetcher_and_xml_to_json_parse(body)
def serialize(self, body):
#TODO(enikanorov): implement better json to xml conversion
# TODO(enikanorov): implement better json to xml conversion
# expecting the dict with single key
root = body.keys()[0]
post_body = common.Element(root)

@ -22,5 +22,5 @@ class BackupsClientXML(backups_client.BackupsClientJSON):
"""
TYPE = "xml"
#TODO(gfidente): XML client isn't yet implemented because of bug 1270589
# TODO(gfidente): XML client isn't yet implemented because of bug 1270589
pass

@ -28,9 +28,9 @@ class VolumeAttachDeleteTest(stressaction.StressAction):
# Step 1: create volume
name = data_utils.rand_name("volume")
self.logger.info("creating volume: %s" % name)
resp, volume = self.manager.volumes_client.create_volume(size=1,
display_name=
name)
resp, volume = self.manager.volumes_client.create_volume(
size=1,
display_name=name)
assert(resp.status == 200)
self.manager.volumes_client.wait_for_volume_status(volume['id'],
'available')

@ -81,9 +81,9 @@ class VolumeVerifyStress(stressaction.StressAction):
name = data_utils.rand_name("volume")
self.logger.info("creating volume: %s" % name)
volumes_client = self.manager.volumes_client
resp, self.volume = volumes_client.create_volume(size=1,
display_name=
name)
resp, self.volume = volumes_client.create_volume(
size=1,
display_name=name)
assert(resp.status == 200)
volumes_client.wait_for_volume_status(self.volume['id'],
'available')

@ -396,7 +396,7 @@ class NegativeAutoTest(BaseTestCase):
:param file: the file name
"""
#NOTE(mkoderer): must be extended for xml support
# NOTE(mkoderer): must be extended for xml support
fn = os.path.join(
os.path.abspath(os.path.dirname(os.path.dirname(__file__))),
"etc", "schemas", file)

@ -80,8 +80,8 @@ class InstanceRunTest(boto_test.BotoTestCase):
if state != "available":
for _image in cls.images.itervalues():
cls.ec2_client.deregister_image(_image["image_id"])
raise exceptions.EC2RegisterImageException(image_id=
image["image_id"])
raise exceptions.EC2RegisterImageException(
image_id=image["image_id"])
@test.attr(type='smoke')
def test_run_idempotent_instances(self):

@ -99,7 +99,8 @@ import_exceptions = tempest.services
[flake8]
# E125 is a won't fix until https://github.com/jcrocholl/pep8/issues/126 is resolved. For further detail see https://review.openstack.org/#/c/36788/
# Skipped because of new hacking 0.9: H407,H405,H904,H305,E123,H307,E122,E129,E128,H402,E251,E265
ignore = E125,H404,H407,H405,H904,H305,E123,H307,E122,E129,E128,H402,E251,E265
# H402 skipped because some docstrings aren't sentences
# Skipped because of new hacking 0.9: H407,H405,H904,H305,E123,H307,E122,E129,E128
ignore = E125,H402,H404,H407,H405,H904,H305,E123,H307,E122,E129,E128
show-source = True
exclude = .git,.venv,.tox,dist,doc,openstack,*egg