Cleanup and gate on hacking E713 rule
This fixes the offending instances of the rule and removes it from the ignore list in tox.ini so that we can gate on the E713 rule. Change-Id: I1f9ef23a8569252b5b6fa660d0d200b1702056d0
This commit is contained in:
@@ -239,7 +239,7 @@ class ServersController(wsgi.Controller):
|
||||
# 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
|
||||
|
||||
@@ -1266,7 +1266,7 @@ class Controller(wsgi.Controller):
|
||||
@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)
|
||||
|
||||
@@ -55,7 +55,7 @@ class ConvertedException(webob.exc.WSGIHTTPException):
|
||||
|
||||
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):
|
||||
|
||||
@@ -117,7 +117,7 @@ class _GroupAntiAffinityFilter(AffinityFilter):
|
||||
"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
|
||||
|
||||
@@ -158,14 +158,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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
4
tox.ini
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]
|
||||
|
||||
Reference in New Issue
Block a user