Cleanup and gate on pep8 rules that are stricter in hacking 0.9

Fix up pep8 failures for rules we previously gated on, but that are now
stricter in there enforcement.

Ignore E251 due to https://github.com/jcrocholl/pep8/issues/301

Change-Id: I62b33e97c44c4a5be436b381cfbdaeb31cd2638b
This commit is contained in:
Joe Gordon
2014-06-09 14:45:26 -07:00
parent 25ea5f480d
commit 87a08aafd8
9 changed files with 14 additions and 13 deletions

View File

@@ -688,7 +688,7 @@ class CloudController(object):
def _get_source_project_id(self, context, source_security_group_owner_id):
if source_security_group_owner_id:
# Parse user:project for source group.
# Parse user:project for source group.
source_parts = source_security_group_owner_id.split(':')
# If no project name specified, assume it's same as user name.

View File

@@ -214,8 +214,8 @@ class BlockDeviceDict(dict):
legacy_block_device['virtual_name'] = None
elif source_type == 'image':
if destination_type != 'volume':
# NOTE(ndipanov): Image bdms with local destination
# have no meaning in the legacy format - raise
# NOTE(ndipanov): Image bdms with local destination
# have no meaning in the legacy format - raise
raise exception.InvalidBDMForLegacy()
legacy_block_device['virtual_name'] = None

View File

@@ -61,13 +61,13 @@ class LiveMigrationTask(object):
self._check_requested_destination()
#TODO(johngarbutt) need to move complexity out of compute manager
#TODO(johngarbutt) disk_over_commit?
return self.compute_rpcapi.live_migration(self.context,
host=self.source,
instance=self.instance,
dest=self.destination,
block_migration=self.block_migration,
migrate_data=self.migrate_data)
#TODO(johngarbutt) disk_over_commit?
def rollback(self):
#TODO(johngarbutt) need to implement the clean up operation

View File

@@ -1457,8 +1457,8 @@ def console_get(context, console_id, instance_uuid=None):
"""Get a specific console (possibly on a given instance)."""
return IMPL.console_get(context, console_id, instance_uuid)
##################
##################
def flavor_create(context, values, projects=None):
"""Create a new instance type."""

View File

@@ -557,7 +557,7 @@ class CinderCloudTestCase(test.TestCase):
'ebs': {'status': 'attached',
'deleteOnTermination': False,
'volumeId': 'vol-0000000b', }}]
# NOTE(yamahata): swap/ephemeral device case isn't supported yet.
# NOTE(yamahata): swap/ephemeral device case isn't supported yet.
_expected_instance_bdm2 = {
'instanceId': 'i-00000002',

View File

@@ -93,8 +93,8 @@ def fake_show_port(self, context, port_id, **kwargs):
def fake_attach_interface(self, context, instance, network_id, port_id,
requested_ip='192.168.1.3'):
if not network_id:
# if no network_id is given when add a port to an instance, use the
# first default network.
# if no network_id is given when add a port to an instance, use the
# first default network.
network_id = fake_networks[0]
if network_id == 'bad_id':
raise exception.NetworkNotFound(network_id=network_id)

View File

@@ -93,8 +93,8 @@ def fake_show_port(self, context, port_id, **kwargs):
def fake_attach_interface(self, context, instance, network_id, port_id,
requested_ip='192.168.1.3'):
if not network_id:
# if no network_id is given when add a port to an instance, use the
# first default network.
# if no network_id is given when add a port to an instance, use the
# first default network.
network_id = fake_networks[0]
if network_id == 'bad_id':
raise exception.NetworkNotFound(network_id=network_id)

View File

@@ -627,7 +627,7 @@ def _set_passwd(username, admin_passwd, passwd_data, shadow_data):
p_file = passwd_data.split("\n")
s_file = shadow_data.split("\n")
# username MUST exist in passwd file or it's an error
# username MUST exist in passwd file or it's an error
found = False
for entry in p_file:
split_entry = entry.split(':')

View File

@@ -58,9 +58,10 @@ 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
# Stricter in hacking 0.9: F402, F812
# E251 Skipped due to https://github.com/jcrocholl/pep8/issues/301
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
ignore = E121,E122,E123,E124,E125,E129,E126,E127,E128,E131,E251,E265,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]