Skip to content

Commit

Permalink
Cleanup and gate on pep8 rules that are stricter in hacking 0.9
Browse files Browse the repository at this point in the history
Fix up pep8 failures for rules we previously gated on, but that are now
stricter in there enforcement.

Ignore E251 due to PyCQA/pycodestyle#301

Change-Id: I62b33e97c44c4a5be436b381cfbdaeb31cd2638b
  • Loading branch information
jogo committed Jun 17, 2014
1 parent 25ea5f4 commit 87a08aa
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion nova/api/ec2/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ def authorize_security_group_ingress(self, context, group_name=None,

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.
Expand Down
4 changes: 2 additions & 2 deletions nova/block_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ def legacy(self):
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

Expand Down
2 changes: 1 addition & 1 deletion nova/conductor/tasks/live_migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ def execute(self):
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
Expand Down
2 changes: 1 addition & 1 deletion nova/db/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down
2 changes: 1 addition & 1 deletion nova/tests/api/ec2/test_cinder_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ def _tearDownBlockDeviceMapping(self, inst1, inst2, volumes):
'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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion nova/virt/disk/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(':')
Expand Down
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 87a08aa

Please sign in to comment.