# 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
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:
commands = bash tools/lintstack.sh
[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