Comment 3 for bug 1461665

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/188231
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=27236e3d6ab163c9032463b781b125ed62cd8afd
Submitter: Jenkins
Branch: master

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).

    Closes-Bug: #1461665

    Change-Id: I9f5f537eff58fe83caa7bff2fb0800ce9f7272fa