Ignore:
Timestamp:
Jun 2, 2008, 11:40:51 PM (17 years ago)
Author:
ecprice
Message:

Fix a couple bugs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-www/code/validation.py

    r573 r575  
    8585        return MAX_MEMORY_SINGLE
    8686    machines = getMachinesByOwner(owner, machine)
    87     active_machines = [x for x in machines if g.xmlist.get(x)]
     87    active_machines = [m for m in machines if m.name in g.xmlist_raw]
    8888    mem_usage = sum([x.memory for x in active_machines if x != machine])
    8989    return min(MAX_MEMORY_SINGLE, MAX_MEMORY_TOTAL-mem_usage)
     
    105105def cantAddVm(owner, g):
    106106    machines = getMachinesByOwner(owner)
    107     active_machines = [x for x in machines if g.xmlist.get(x)]
     107    active_machines = [m for m in machines if m.name in g.xmlist_raw]
    108108    if len(machines) >= MAX_VMS_TOTAL:
    109109        return 'You have too many VMs to create a new one.'
     
    201201    admin).  XXX is modifying this a good idea?
    202202    """
    203     if admin in (None, machine.administrator):
     203    if admin is None:
     204        return None
     205    if machine is not None and admin == machine.administrator:
    204206        return None
    205207    if admin == user:
Note: See TracChangeset for help on using the changeset viewer.