~ubuntu-branches/ubuntu/precise/nova/precise

« back to all changes in this revision

Viewing changes to nova/db/sqlalchemy/api.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-04-04 09:25:14 UTC
  • mfrom: (1.1.52)
  • Revision ID: package-import@ubuntu.com-20120404092514-ry1k7mjzd6plivdk
Tags: 2012.1~rc3-0ubuntu1
* New Upstream release. 
* debian/control: Conflict nova-vncproxy with novnc.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2232
2232
 
2233
2233
@require_admin_context
2234
2234
def quota_create(context, project_id, resource, limit):
 
2235
    # NOTE: Treat -1 as unlimited for consistency w/ flags
 
2236
    if limit == -1:
 
2237
        limit = None
2235
2238
    quota_ref = models.Quota()
2236
2239
    quota_ref.project_id = project_id
2237
2240
    quota_ref.resource = resource
2242
2245
 
2243
2246
@require_admin_context
2244
2247
def quota_update(context, project_id, resource, limit):
 
2248
    # NOTE: Treat -1 as unlimited for consistency w/ flags
 
2249
    if limit == -1:
 
2250
        limit = None
2245
2251
    session = get_session()
2246
2252
    with session.begin():
2247
2253
        quota_ref = quota_get(context, project_id, resource, session=session)