Test for membership should be 'not in'

Enabled check for PEP8 issue E713.

Change-Id: Id41f5f19796a7af8cf4cb52dd7afc2e6ec1ccbc4
This commit is contained in:
Christian Berendt 2014-06-03 08:22:57 +02:00 committed by Dmitry Tantsur
parent 3a2582a866
commit 164f963676
3 changed files with 4 additions and 3 deletions

View File

@ -43,7 +43,7 @@ CONF.register_opts(exc_log_opts)
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)
class IronicException(Exception):

View File

@ -58,7 +58,7 @@ def _get_root_helper():
def execute(*cmd, **kwargs):
"""Convenience wrapper around oslo's execute() method."""
if kwargs.get('run_as_root') and not 'root_helper' in kwargs:
if kwargs.get('run_as_root') and 'root_helper' not in kwargs:
kwargs['root_helper'] = _get_root_helper()
result = processutils.execute(*cmd, **kwargs)
LOG.debug('Execution completed, command line is "%s"', ' '.join(cmd))
@ -69,7 +69,7 @@ def execute(*cmd, **kwargs):
def trycmd(*args, **kwargs):
"""Convenience wrapper around oslo's trycmd() method."""
if kwargs.get('run_as_root') and not 'root_helper' in kwargs:
if kwargs.get('run_as_root') and 'root_helper' not in kwargs:
kwargs['root_helper'] = _get_root_helper()
return processutils.trycmd(*args, **kwargs)

View File

@ -37,6 +37,7 @@ commands = {posargs}
# E711: ignored because it is normal to use "column == None" in sqlalchemy
ignore = E12,E711
select = E713
builtins = _
exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools,*ironic/nova*