diff --git a/manila/db/sqlalchemy/api.py b/manila/db/sqlalchemy/api.py index 3a5e8d1653..c7abb52c31 100644 --- a/manila/db/sqlalchemy/api.py +++ b/manila/db/sqlalchemy/api.py @@ -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)] diff --git a/releasenotes/notes/bug-1872872-fix-quota-checking-b06fd372be143101.yaml b/releasenotes/notes/bug-1872872-fix-quota-checking-b06fd372be143101.yaml new file mode 100644 index 0000000000..b00ac3ba03 --- /dev/null +++ b/releasenotes/notes/bug-1872872-fix-quota-checking-b06fd372be143101.yaml @@ -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 + `_ for more details.