Update pep8 testing

Remove comment about H904 since H904 has been removed from hacking,
there's no need to fix it.
Remove E712 ignore since the code is clean.
Remove E711 ignore and fix the problems in manila/db/sqlalchemy/api.py to
make it pass.
Remove H304 ignore since the code is clean.

Change-Id: I4f9477a61d6f1ddde16b5ff9e387c76076c89d6e
This commit is contained in:
Andreas Jaeger 2014-07-28 22:56:45 +02:00
parent da0e39f175
commit e4911b178d
2 changed files with 5 additions and 6 deletions

View File

@ -631,7 +631,7 @@ def _quota_usage_get_all(context, project_id, user_id=None):
result = {'project_id': project_id}
if user_id:
query = query.filter(or_(models.QuotaUsage.user_id == user_id,
models.QuotaUsage.user_id == None))
models.QuotaUsage.user_id is None))
result['user_id'] = user_id
rows = query.all()
@ -685,7 +685,7 @@ def quota_usage_update(context, project_id, user_id, resource, **kwargs):
filter_by(project_id=project_id).\
filter_by(resource=resource).\
filter(or_(models.QuotaUsage.user_id == user_id,
models.QuotaUsage.user_id == None)).\
models.QuotaUsage.user_id is None)).\
update(updates)
if not result:
@ -743,7 +743,7 @@ def _get_user_quota_usages(context, session, project_id, user_id):
session=session).\
filter_by(project_id=project_id).\
filter(or_(models.QuotaUsage.user_id == user_id,
models.QuotaUsage.user_id == None)).\
models.QuotaUsage.user_id is None)).\
with_lockmode('update').\
all()
return dict((row.resource, row) for row in rows)
@ -1994,7 +1994,7 @@ def volume_get_active_by_window(context,
project_id=None):
"""Return volumes that were active during window."""
query = model_query(context, models.Share, read_deleted="yes")
query = query.filter(or_(models.Share.deleted_at == None,
query = query.filter(or_(models.Share.deleted_at is None,
models.Share.deleted_at > begin))
if end:
query = query.filter(models.Share.created_at < end)

View File

@ -42,7 +42,6 @@ commands = bash tools/lintstack.sh
# TODO: These are not intentionally disabled, reenable when fixed:
# H405: multi line docstring summary not separated with an empty line
# H501: Do not use locals() for string formatting
# H904: Wrap long lines in parentheses instead of a backslash
ignore = E12,E711,E712,H302,H303,H304,H402,H404,H405,H501,H904,F
ignore = E12,H302,H303,H402,H404,H405,H501,H904,F
builtins = _
exclude = .venv,.tox,dist,doc,openstack,*egg