X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/blobdiff_plain/4663602deda7a8c90d59c8d3a57cd5a3945d73ca..10e4a20f31223709b58e75ae75e585cf3050bb0d:/main.py?ds=sidebyside diff --git a/main.py b/main.py index e7412ba..e8d199d 100755 --- a/main.py +++ b/main.py @@ -149,8 +149,8 @@ def parseCreate(user, fields): memory = fields.getfirst('memory') memory = validation.validMemory(user, memory, on=True) - disk = fields.getfirst('disk') - disk = validation.validDisk(user, disk) + disk_size = fields.getfirst('disk') + disk_size = validation.validDisk(user, disk_size) vm_type = fields.getfirst('vmtype') if vm_type not in ('hvm', 'paravm'): @@ -160,7 +160,7 @@ def parseCreate(user, fields): cdrom = fields.getfirst('cdrom') if cdrom is not None and not CDROM.get(cdrom): raise CodeError("Invalid cdrom type '%s'" % cdrom) - return dict(contact=user, name=name, memory=memory, disk=disk, + return dict(contact=user, name=name, memory=memory, disk_size=disk_size, owner=owner, is_hvm=is_hvm, cdrom=cdrom) def create(user, fields): @@ -184,8 +184,12 @@ def create(user, fields): def getListDict(user): - machines = [m for m in Machine.select() - if validation.haveAccess(user, m)] + machines = [m for m in Machine.select() + if validation.haveAccess(user, m)] + #if user == 'moo': + # machines = Machine.select() + #else: + # machines = Machine.query().join('users').filter_by(user=user).all() checkpoint.checkpoint('Got my machines') on = {} has_vnc = {}