Browse Source

fix bug in quota checking

When project quota set unlimited(-1), and user in the
project is limited to a value.Then project quota must
smaller than project usage when checking quotas, which
means the value 'overs' is not None.
In this case, even though the user not over the quota,
but they can not create share

Closes-bug: #1872872

Change-Id: Id9e2bcb5d30d2b81b0723dd296b537ac7d4519f2
(cherry picked from commit 7800539682)
(cherry picked from commit 73837ce05a)
(cherry picked from commit f2afb50fbb)
changes/14/723814/1
zhangqing 3 months ago
committed by Goutham Pacha Ravi
parent
commit
b99b57825e
2 changed files with 8 additions and 1 deletions
  1. +1
    -1
      manila/db/sqlalchemy/api.py
  2. +7
    -0
      releasenotes/notes/bug-1872872-fix-quota-checking-b06fd372be143101.yaml

+ 1
- 1
manila/db/sqlalchemy/api.py View File

@@ -1057,7 +1057,7 @@ def _quota_reserve(context, resources, project_quotas, user_or_st_quotas,
project_usages[key] = value
overs = [res for res, delta in deltas.items()
if user_or_st_quotas[res] >= 0 and delta >= 0 and
(project_quotas[res] < delta +
(0 <= project_quotas[res] < delta +
project_usages[res]['total'] or
user_or_st_quotas[res] < delta +
user_or_st_usages[res].total)]


+ 7
- 0
releasenotes/notes/bug-1872872-fix-quota-checking-b06fd372be143101.yaml View File

@@ -0,0 +1,7 @@
---
fixes:
- |
Fixed quota issue that made it impossible to create resources when the project had the quotas
set to unlimited, and the user had a limited amount of quotas to use. Now, operations in the
mentioned quota scenario are working properly. Please see `Launchpad bug 1872872
<https://bugs.launchpad.net/manila/+bug/1872872>`_ for more details.

Loading…
Cancel
Save