Changeset 2199 for trunk/packages


Ignore:
Timestamp:
Feb 27, 2009, 2:56:46 AM (16 years ago)
Author:
price
Message:

invirt-quota: more style fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/invirt-database/scripts/invirt-quota

    r2198 r2199  
    4444        parser.print_help(sys.stderr)
    4545        return 1
    46     owner = args[0]
     46    owner_id = args[0]
    4747    database.connect()
    4848    database.session.begin()
    4949   
    50     x = database.Owner.query().filter_by(owner_id=owner).first()
    51     if x is None:
    52         x = database.Owner(owner_id=owner)
     50    owner = database.Owner.query().filter_by(owner_id=owner_id).first()
     51    if owner is None:
     52        owner = database.Owner(owner_id=owner_id)
    5353
    5454    for resource, scope in [('ram',  'total'), ('ram',  'single'),
     
    5757        val = getattr(opts, resource+scope)
    5858        if val is not None:
    59             setattr(x, resource+'_quota_'+scope, val if val >= 0 else None)
     59            setattr(owner, resource+'_quota_'+scope, val if val >= 0 else None)
    6060
    6161    database.session.commit()
    62     print str(x)
     62    print owner
    6363    return 0
    6464
Note: See TracChangeset for help on using the changeset viewer.