Changeset 575 for trunk/packages/sipb-xen-www
- Timestamp:
- Jun 2, 2008, 11:40:51 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-www/code/validation.py
r573 r575 85 85 return MAX_MEMORY_SINGLE 86 86 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] 88 88 mem_usage = sum([x.memory for x in active_machines if x != machine]) 89 89 return min(MAX_MEMORY_SINGLE, MAX_MEMORY_TOTAL-mem_usage) … … 105 105 def cantAddVm(owner, g): 106 106 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] 108 108 if len(machines) >= MAX_VMS_TOTAL: 109 109 return 'You have too many VMs to create a new one.' … … 201 201 admin). XXX is modifying this a good idea? 202 202 """ 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: 204 206 return None 205 207 if admin == user:
Note: See TracChangeset
for help on using the changeset viewer.