Ignore:
Timestamp:
Mar 7, 2008, 1:19:36 PM (17 years ago)
Author:
ecprice
Message:

Fix bug resulting from partial uptimes list from r261

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/web/validation.py

    r254 r277  
    4444        return MAX_MEMORY_SINGLE
    4545    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)]
    4747    mem_usage = sum([x.memory for x in active_machines if x != machine])
    4848    return min(MAX_MEMORY_SINGLE, MAX_MEMORY_TOTAL-mem_usage)
     
    5656def cantAddVm(user):
    5757    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)]
    5959    if len(machines) >= MAX_VMS_TOTAL:
    6060        return 'You have too many VMs to create a new one.'
Note: See TracChangeset for help on using the changeset viewer.