Merge "Start using Pyflakes"
This commit is contained in:
commit
67249826cb
@ -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
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user