Fix H401,H402 violations and re-enable gating

H401 and H402 got stricter in hacking 0.9, so fix new violations and
re-enable gating.

Change-Id: I4785d14edee1ffdf32e2900f6e6234cbecab6d8a
This commit is contained in:
Joe Gordon 2014-06-09 11:45:57 -07:00
parent 518b2766ba
commit e59a64596f
5 changed files with 9 additions and 9 deletions

View File

@ -279,7 +279,7 @@ class JSONDeserializerTest(test.NoDBTestCase):
self.assertEqual(deserializer.deserialize(data), as_dict)
def test_json_invalid_utf8(self):
""" Send invalid utf-8 to JSONDeserializer"""
"""Send invalid utf-8 to JSONDeserializer."""
data = """{"server": {"min_count": 1, "flavorRef": "1",
"name": "\xf0\x28\x8c\x28",
"imageRef": "10bab10c-1304-47d",
@ -327,7 +327,7 @@ class XMLDeserializerTest(test.NoDBTestCase):
self.assertEqual(deserializer.deserialize(xml), as_dict)
def test_xml_invalid_utf8(self):
""" Send invalid utf-8 to XMLDeserializer"""
"""Send invalid utf-8 to XMLDeserializer."""
xml = """ <a><name>\xf0\x28\x8c\x28</name></a> """
deserializer = wsgi.XMLDeserializer()
self.assertRaises(exception.MalformedRequestBody,

View File

@ -2368,7 +2368,7 @@ class VMwareAPIVCDriverTestCase(VMwareAPIVMTestCase):
self.conn.get_host_uptime, 'host')
def _test_finish_migration(self, power_on, resize_instance=False):
"""Tests the finish_migration method on VC Driver"""
"""Tests the finish_migration method on VC Driver."""
# setup the test instance in the database
self._create_vm()
vm_ref = vm_util.get_vm_ref(self.conn._session,
@ -2431,7 +2431,7 @@ class VMwareAPIVCDriverTestCase(VMwareAPIVMTestCase):
@mock.patch.object(vm_util, 'power_on_instance')
def _test_finish_revert_migration(self, fake_power_on,
fake_associate_vmref, power_on):
"""Tests the finish_revert_migration method on VC Driver"""
"""Tests the finish_revert_migration method on VC Driver."""
# setup the test instance in the database
self._create_instance()

View File

@ -1298,7 +1298,7 @@ class LibvirtConfigGuestSnapshot(LibvirtConfigObject):
class LibvirtConfigNodeDevice(LibvirtConfigObject):
"""Libvirt Node Devices parser"""
"""Libvirt Node Devices parser."""
def __init__(self, **kwargs):
super(LibvirtConfigNodeDevice, self).__init__(root_name="device",
@ -1323,7 +1323,7 @@ class LibvirtConfigNodeDevice(LibvirtConfigObject):
class LibvirtConfigNodeDevicePciCap(LibvirtConfigObject):
"""Libvirt Node Devices pci capability parser"""
"""Libvirt Node Devices pci capability parser."""
def __init__(self, **kwargs):
super(LibvirtConfigNodeDevicePciCap, self).__init__(

View File

@ -265,7 +265,7 @@ class DataObject(object):
class HostInternetScsiHba(DataObject):
"""iSCSI Host Bus Adapter"""
"""iSCSI Host Bus Adapter."""
def __init__(self):
super(HostInternetScsiHba, self).__init__()

View File

@ -58,9 +58,9 @@ sitepackages = False
# E125 is deliberately excluded. See https://github.com/jcrocholl/pep8/issues/126
# The rest of the ignores are TODOs
# New from hacking 0.9: E129, E131, E265, E713, H407, H405, H904
# Stricter in hacking 0.9: E111, E112, E113, E251, E303, F402, F812,H401,H402
# Stricter in hacking 0.9: E111, E112, E113, E251, E303, F402, F812
ignore = E111,E112,E113,E121,E122,E123,E124,E125,E129,E126,E127,E128,E131,E251,E265,E303,E711,E712,E713,F811,F402,F812,H305,H307,H401,H402,H405,H803,H904
ignore = E111,E112,E113,E121,E122,E123,E124,E125,E129,E126,E127,E128,E131,E251,E265,E303,E711,E712,E713,F811,F402,F812,H305,H307,H405,H803,H904
exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools
[hacking]