コード例 #1
0
ファイル: utils.py プロジェクト: wirespecter/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
コード例 #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
ファイル: utils.py プロジェクト: laashub-soa/magnum
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)