Changeset 2132 for trunk/packages/invirt-web
- Timestamp:
- Feb 16, 2009, 11:52:01 PM (16 years ago)
- Location:
- trunk/packages/invirt-web
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/invirt-web/code/validation.py
r2064 r2132 6 6 import string 7 7 import dns.resolver 8 from invirt.database import Machine, NIC, Type, Disk, CDROM, Autoinstall 8 from invirt.database import Machine, NIC, Type, Disk, CDROM, Autoinstall, Owner 9 9 from invirt.config import structs as config 10 10 from invirt.common import InvalidInput, CodeError 11 11 12 MAX_MEMORY_TOTAL = 51213 MAX_MEMORY_SINGLE = 51214 12 MIN_MEMORY_SINGLE = 16 15 13 MAX_DISK_TOTAL = 50 … … 92 90 returned. 93 91 """ 94 if machine is not None and machine.memory > MAX_MEMORY_SINGLE: 95 # If they've been blessed, let them have it 96 return machine.memory 92 (quota_total, quota_single) = Owner.getQuotas(machine.owner if machine else owner) 93 97 94 if not on: 98 return MAX_MEMORY_SINGLE95 return quota_single 99 96 machines = getMachinesByOwner(owner, machine) 100 97 active_machines = [m for m in machines if m.name in g.xmlist_raw] 101 98 mem_usage = sum([x.memory for x in active_machines if x != machine]) 102 return min( MAX_MEMORY_SINGLE, MAX_MEMORY_TOTAL-mem_usage)99 return min(quota_single, quota_total-mem_usage) 103 100 104 101 def maxDisk(owner, machine=None): -
trunk/packages/invirt-web/debian/changelog
r2063 r2132 1 invirt-web (0.0.19) unstable; urgency=low 2 3 * modified quota checking to refer to invirt.database.Owner for quotas and defaults 4 5 -- Peter A. Iannucci <iannucci@mit.edu> Mon, 16 Feb 2009 23:49:21 -0500 6 1 7 invirt-web (0.0.18) unstable; urgency=low 2 8
Note: See TracChangeset
for help on using the changeset viewer.