Replace None comparisons in SQLAlchemy code

SQLAlchemy requires '==' to compare to None, but using '== None'
comparisons triggers the pep8 error E711. Another way to do '=='
comparisons for SQLAlchemy is using its is_() method.

This patch replaces all '== None' comparisons with 'is_(None)', which
does not trigger the pep8 error. Because there are no more E711
vialotions left, this patch also removes E711 from the pep8 ignore list
in tox.ini.

Change-Id: I96bd835688176c87d3f8079421c3394c1d431d43
This commit is contained in:
Daniel Gonzalez
2016-01-17 17:38:20 +01:00
parent 9c06897c7a
commit 5bf06f973f
2 changed files with 6 additions and 19 deletions

View File

@@ -94,8 +94,6 @@ commands =
/bin/bash {toxinidir}/functionaltests/pretty_tox.sh '{posargs}'
[flake8]
# E711 ignored because of sqlalchemy override of == None
ignore = E711
exclude = .git,.idea,.tox,bin,dist,debian,rpmbuild,tools,*.egg-info,*.eggs,*openstack/common,contrib,
functionaltests,*alembic_migrations/versions,*docs/target,*.egg