示例#1
0
def get_test_quota(context, **kw):
    """Return a Quota object with appropriate attributes.

    NOTE: The object leaves the attributes marked as changed, such
    that a create() could be used to commit it to the DB.
    """
    db_quota = db_utils.get_test_quota(**kw)
    # Let DB generate ID if it isn't specified explicitly
    if 'id' not in kw:
        del db_quota['id']
    quota = objects.Quota(context)
    for key in db_quota:
        setattr(quota, key, db_quota[key])
    return quota
示例#2
0
文件: utils.py 项目: openstack/magnum
def get_test_quota(context, **kw):
    """Return a Quota object with appropriate attributes.

    NOTE: The object leaves the attributes marked as changed, such
    that a create() could be used to commit it to the DB.
    """
    db_quota = db_utils.get_test_quota(**kw)
    # Let DB generate ID if it isn't specified explicitly
    if 'id' not in kw:
        del db_quota['id']
    quota = objects.Quota(context)
    for key in db_quota:
        setattr(quota, key, db_quota[key])
    return quota
示例#3
0
def quota_post_data(**kw):
    return utils.get_test_quota(**kw)
示例#4
0
文件: utils.py 项目: ragnaray/magnum
def quota_post_data(**kw):
    return utils.get_test_quota(**kw)