Changeset 277 for trunk/web/validation.py
- Timestamp:
- Mar 7, 2008, 1:19:36 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web/validation.py
r254 r277 44 44 return MAX_MEMORY_SINGLE 45 45 machines = getMachinesByOwner(user, machine) 46 active_machines = [x for x in machines if g.uptimes [x]]46 active_machines = [x for x in machines if g.uptimes.get(x)] 47 47 mem_usage = sum([x.memory for x in active_machines if x != machine]) 48 48 return min(MAX_MEMORY_SINGLE, MAX_MEMORY_TOTAL-mem_usage) … … 56 56 def cantAddVm(user): 57 57 machines = getMachinesByOwner(user) 58 active_machines = [x for x in machines if g.uptimes [x]]58 active_machines = [x for x in machines if g.uptimes.get(x)] 59 59 if len(machines) >= MAX_VMS_TOTAL: 60 60 return 'You have too many VMs to create a new one.'
Note: See TracChangeset
for help on using the changeset viewer.