summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Berendt <berendt@b1-systems.de>2014-06-03 08:22:57 +0200
committerDmitry Tantsur <dtantsur@redhat.com>2014-06-16 13:19:11 +0200
commit164f9636764ee8f9a7582ef5d97cd0b3c98a2fbf (patch)
tree8145b592fe38da95475301007ca2d009a2c03a9a
parent3a2582a86615464779e7545275aa93fdc50d29ea (diff)
downloadironic-164f9636764ee8f9a7582ef5d97cd0b3c98a2fbf.tar.gz
Test for membership should be 'not in'
Enabled check for PEP8 issue E713. Change-Id: Id41f5f19796a7af8cf4cb52dd7afc2e6ec1ccbc4
-rw-r--r--ironic/common/exception.py2
-rw-r--r--ironic/common/utils.py4
-rw-r--r--tox.ini1
3 files changed, 4 insertions, 3 deletions
diff --git a/ironic/common/exception.py b/ironic/common/exception.py
index 89177ddc5..f0318f028 100644
--- a/ironic/common/exception.py
+++ b/ironic/common/exception.py
@@ -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):
diff --git a/ironic/common/utils.py b/ironic/common/utils.py
index 4cbb608cb..213771f97 100644
--- a/ironic/common/utils.py
+++ b/ironic/common/utils.py
@@ -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)
diff --git a/tox.ini b/tox.ini
index ea67431cc..64de8b918 100644
--- a/tox.ini
+++ b/tox.ini
@@ -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*