invirt-quota: more style fixes
authorGreg Price <price@mit.edu>
Fri, 27 Feb 2009 07:56:46 +0000 (02:56 -0500)
committerGreg Price <price@mit.edu>
Fri, 27 Feb 2009 07:56:46 +0000 (02:56 -0500)
svn path=/trunk/packages/invirt-database/; revision=2199

scripts/invirt-quota

index 22c663a..f0fb16f 100755 (executable)
@@ -43,23 +43,23 @@ def main(argv):
     if len(args) != 1:
         parser.print_help(sys.stderr)
         return 1
-    owner = args[0]
+    owner_id = args[0]
     database.connect()
     database.session.begin()
     
-    x = database.Owner.query().filter_by(owner_id=owner).first()
-    if x is None:
-        x = database.Owner(owner_id=owner)
+    owner = database.Owner.query().filter_by(owner_id=owner_id).first()
+    if owner is None:
+        owner = database.Owner(owner_id=owner_id)
 
     for resource, scope in [('ram',  'total'), ('ram',  'single'),
                             ('disk', 'total'), ('disk', 'single'),
                             ('vms',  'total'), ('vms',  'active')]:
         val = getattr(opts, resource+scope)
         if val is not None:
-            setattr(x, resource+'_quota_'+scope, val if val >= 0 else None)
+            setattr(owner, resource+'_quota_'+scope, val if val >= 0 else None)
 
     database.session.commit()
-    print str(x)
+    print owner
     return 0
 
 if __name__ == '__main__':