X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/blobdiff_plain/102769b5296d5a4895fff466def7c99f8a255fb3..ed3be7ee0d8af0cb884233327a3062c2be614d15:/templates/controls.py diff --git a/templates/controls.py b/templates/controls.py index 1e769b0..3671f21 100644 --- a/templates/controls.py +++ b/templates/controls.py @@ -87,14 +87,14 @@ def unregisterMachine(machine): """Unregister a machine to not be controlled by the web interface""" remctl('web', 'unregister', machine.name) -def createVm(user, name, memory, disk, is_hvm, cdrom): +def createVm(owner, contact, name, memory, disk, is_hvm, cdrom): """Create a VM and put it in the database""" # put stuff in the table transaction = ctx.current.create_transaction() try: - validation.validMemory(user, memory) - validation.validDisk(user, disk * 1. / 1024) - validation.validAddVm(user) + validation.validMemory(owner, memory) + validation.validDisk(owner, disk * 1. / 1024) + validation.validAddVm(owner) res = meta.engine.execute('select nextval(' '\'"machines_machine_id_seq"\')') id = res.fetchone()[0] @@ -102,9 +102,9 @@ def createVm(user, name, memory, disk, is_hvm, cdrom): machine.machine_id = id machine.name = name machine.memory = memory - machine.owner = user.username - machine.administrator = user.username - machine.contact = user.email + machine.owner = owner + machine.administrator = owner + machine.contact = contact machine.uuid = uuidToString(randomUUID()) machine.boot_off_cd = True machine_type = Type.get_by(hvm=is_hvm)