X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/blobdiff_plain/a8aa7e93e31e7c9dee007c3fbda010a158607ce4..fa88b9bd09fdc75e26422604bb2b74821e3a9b07:/code/main.py diff --git a/code/main.py b/code/main.py index c0e9a98..df2ef4e 100755 --- a/code/main.py +++ b/code/main.py @@ -152,9 +152,7 @@ def parseCreate(user, fields): disk_size = validation.validDisk(owner, disk_size) vm_type = fields.getfirst('vmtype') - if vm_type not in ('hvm', 'paravm'): - raise CodeError("Invalid vm type '%s'" % vm_type) - is_hvm = (vm_type == 'hvm') + vm_type = validation.validVmType(vm_type) cdrom = fields.getfirst('cdrom') if cdrom is not None and not CDROM.get(cdrom): @@ -165,7 +163,7 @@ def parseCreate(user, fields): raise CodeError("Invalid clone image '%s'" % clone_from) return dict(contact=user, name=name, memory=memory, disk_size=disk_size, - owner=owner, is_hvm=is_hvm, cdrom=cdrom, clone_from=clone_from) + owner=owner, machine_type=vm_type, cdrom=cdrom, clone_from=clone_from) def create(user, fields): """Handler for create requests."""