invirt-quota: more style fixes
[invirt/packages/invirt-database.git] / 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
     if len(args) != 1:
         parser.print_help(sys.stderr)
         return 1
-    owner = args[0]
+    owner_id = args[0]
     database.connect()
     database.session.begin()
     
     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:
 
     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()
 
     database.session.commit()
-    print str(x)
+    print owner
     return 0
 
 if __name__ == '__main__':
     return 0
 
 if __name__ == '__main__':