commit 27236e3d6ab163c9032463b781b125ed62cd8afd
Author: Matt Riedemann <email address hidden>
Date: Wed Jun 3 19:00:02 2015 -0700
Fix _quota_reserve test setup for incompatible type checking
The db.quota_reserve() method expects to get project_quotas and
user_quotas as dicts that map resource types to limits which are ints.
The _quota_reserve test setup method was just mapping the resource type
to the Quota sqlalchemy dict-like object that was coming back from
db.quota_create. Since db._calculate_overquota compares the delta (int)
to the user_quotas/project_quotas value, which was a Quota object, and
py34 doesn't allow incompatible type checks like that, this fails with
py34.
This fixes the _quota_reserve test setup method to map the resource type
to the hard_limit like the actual DB APIs do in the normal nova.quota
flows. It also has to adjust the setup method to avoid going over-quota
immediately due to the limit and usage being the same (which is why we
add a buffer to the i value for the limit).
Reviewed: https:/ /review. openstack. org/188231 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=27236e3d6ab 163c9032463b781 b125ed62cd8afd
Committed: https:/
Submitter: Jenkins
Branch: master
commit 27236e3d6ab163c 9032463b781b125 ed62cd8afd
Author: Matt Riedemann <email address hidden>
Date: Wed Jun 3 19:00:02 2015 -0700
Fix _quota_reserve test setup for incompatible type checking
The db.quota_reserve() method expects to get project_quotas and
user_quotas as dicts that map resource types to limits which are ints.
The _quota_reserve test setup method was just mapping the resource type quota_create. Since db._calculate_ overquota compares the delta (int) project_ quotas value, which was a Quota object, and
to the Quota sqlalchemy dict-like object that was coming back from
db.
to the user_quotas/
py34 doesn't allow incompatible type checks like that, this fails with
py34.
This fixes the _quota_reserve test setup method to map the resource type
to the hard_limit like the actual DB APIs do in the normal nova.quota
flows. It also has to adjust the setup method to avoid going over-quota
immediately due to the limit and usage being the same (which is why we
add a buffer to the i value for the limit).
Closes-Bug: #1461665
Change-Id: I9f5f537eff58fe 83caa7bff2fb080 0ce9f7272fa