Browse files

Merge "Cleanup and gate on hacking E713 rule"

  • Loading branch information...
2 parents d6c2a70 + 51e604f commit 5eae48a9da85fde3ce5f793272d2e037f8ff4eca Jenkins committed with openstack-gerrit Jul 17, 2014
View
2 nova/api/openstack/compute/plugins/v3/servers.py
@@ -239,7 +239,7 @@ def _get_servers(self, req, is_detail):
# disabled. Note that the tenant_id parameter is filtered out
# by remove_invalid_options above unless the requestor is an
# admin.
- if 'tenant_id' in search_opts and not 'all_tenants' in search_opts:
+ if 'tenant_id' in search_opts and 'all_tenants' not in search_opts:
# We do not need to add the all_tenants flag if the tenant
# id associated with the token is the tenant id
# specified. This is done so a request that does not need
View
2 nova/api/openstack/compute/servers.py
@@ -1270,7 +1270,7 @@ def _flavor_id_from_req_data(self, data):
@wsgi.action('changePassword')
def _action_change_password(self, req, id, body):
context = req.environ['nova.context']
- if (not 'changePassword' in body
+ if ('changePassword' not in body
or 'adminPass' not in body['changePassword']):
msg = _("No adminPass was specified")
raise exc.HTTPBadRequest(explanation=msg)
View
2 nova/exception.py
@@ -55,7 +55,7 @@ def __init__(self, code=0, title="", explanation=""):
def _cleanse_dict(original):
"""Strip all admin_password, new_pass, rescue_pass keys from a dict."""
- return dict((k, v) for k, v in original.iteritems() if not "_pass" in k)
+ return dict((k, v) for k, v in original.iteritems() if "_pass" not in k)
def wrap_exception(notifier=None, get_notifier=None):
View
2 nova/scheduler/filters/affinity_filter.py
@@ -117,7 +117,7 @@ def host_passes(self, host_state, filter_properties):
"in %(configured)s", {'host': host_state.host,
'configured': group_hosts})
if group_hosts:
- return not host_state.host in group_hosts
+ return host_state.host not in group_hosts
# No groups configured
return True
View
4 nova/utils.py
@@ -159,14 +159,14 @@ def _get_root_helper():
def execute(*cmd, **kwargs):
"""Convenience wrapper around oslo's execute() method."""
- if 'run_as_root' in kwargs and not 'root_helper' in kwargs:
+ if 'run_as_root' in kwargs and 'root_helper' not in kwargs:
kwargs['root_helper'] = _get_root_helper()
return processutils.execute(*cmd, **kwargs)
def trycmd(*args, **kwargs):
"""Convenience wrapper around oslo's trycmd() method."""
- if 'run_as_root' in kwargs and not 'root_helper' in kwargs:
+ if 'run_as_root' in kwargs and 'root_helper' not in kwargs:
kwargs['root_helper'] = _get_root_helper()
return processutils.trycmd(*args, **kwargs)
View
2 nova/virt/vmwareapi/vm_util.py
@@ -377,7 +377,7 @@ def get_vmdk_path_and_adapter_type(hardware_devices, uuid=None):
def _find_controller_slot(controller_keys, taken, max_unit_number):
for controller_key in controller_keys:
for unit_number in range(max_unit_number):
- if not unit_number in taken.get(controller_key, []):
+ if unit_number not in taken.get(controller_key, []):
return controller_key, unit_number
View
4 tox.ini
@@ -57,11 +57,11 @@ sitepackages = False
# H803 skipped on purpose per list discussion.
# 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
+# New from hacking 0.9: E129, E131, E265, H407, H405, H904
# Stricter in hacking 0.9: F402
# E251 Skipped due to https://github.com/jcrocholl/pep8/issues/301
-ignore = E121,E122,E123,E124,E125,E129,E126,E127,E128,E131,E251,E265,E711,E712,E713,F402,H405,H803,H904
+ignore = E121,E122,E123,E124,E125,E129,E126,E127,E128,E131,E251,E265,E711,E712,F402,H405,H803,H904
exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools
[hacking]

0 comments on commit 5eae48a

Please sign in to comment.