Merge "Start using Pyflakes"

This commit is contained in:
Jenkins 2013-06-16 16:46:27 +00:00 committed by Gerrit Code Review
commit 67249826cb
3 changed files with 8 additions and 9 deletions

View File

@ -745,18 +745,17 @@ def quota_reserve(context, resources, quotas, deltas, expire,
# a best-effort mechanism.
# Check for deltas that would go negative
unders = [resource for resource, delta in deltas.items()
if delta < 0 and
delta + usages[resource].in_use < 0]
unders = [r for r, delta in deltas.items()
if delta < 0 and delta + usages[r].in_use < 0]
# Now, let's check the quotas
# NOTE(Vek): We're only concerned about positive increments.
# If a project has gone over quota, we want them to
# be able to reduce their usage without any
# problems.
overs = [resource for resource, delta in deltas.items()
if quotas[resource] >= 0 and delta >= 0 and
quotas[resource] < delta + usages[resource].total]
overs = [r for r, delta in deltas.items()
if quotas[r] >= 0 and delta >= 0 and
quotas[r] < delta + usages[r].total]
# NOTE(Vek): The quota check needs to be in the transaction,
# but the transaction doesn't fail just because

View File

@ -71,8 +71,8 @@ class SimpleScheduler(chance.ChanceScheduler):
results = db.service_get_all_volume_sorted(elevated)
if zone:
results = [(service, gigs) for (service, gigs) in results
if service['availability_zone'] == zone]
results = [(s, gigs) for (s, gigs) in results
if s['availability_zone'] == zone]
for result in results:
(service, volume_gigabytes) = result
if volume_gigabytes + volume_size > CONF.max_gigabytes:

View File

@ -43,6 +43,6 @@ commands =
commands = {posargs}
[flake8]
ignore = E711,E712,H302,H303,H304,H401,H402,H403,H404,F
ignore = E711,E712,F401,F403,F811,F841,H302,H303,H304,H401,H402,H403,H404
builtins = _
exclude = .venv,.tox,dist,doc,openstack,*egg