Ignore:
Timestamp:
Oct 28, 2007, 11:57:32 PM (17 years ago)
Author:
ecprice
Message:

Remove the useless User class (now user is a string)
Allow creation under another owner.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/web/templates/controls.py

    r216 r228  
    8888    remctl('web', 'unregister', machine.name)
    8989
    90 def createVm(user, name, memory, disk, is_hvm, cdrom):
     90def createVm(owner, contact, name, memory, disk, is_hvm, cdrom):
    9191    """Create a VM and put it in the database"""
    9292    # put stuff in the table
    9393    transaction = ctx.current.create_transaction()
    9494    try:
    95         validation.validMemory(user, memory)
    96         validation.validDisk(user, disk  * 1. / 1024)
    97         validation.validAddVm(user)
     95        validation.validMemory(owner, memory)
     96        validation.validDisk(owner, disk  * 1. / 1024)
     97        validation.validAddVm(owner)
    9898        res = meta.engine.execute('select nextval('
    9999                                  '\'"machines_machine_id_seq"\')')
     
    103103        machine.name = name
    104104        machine.memory = memory
    105         machine.owner = user.username
    106         machine.administrator = user.username
    107         machine.contact = user.email
     105        machine.owner = owner
     106        machine.administrator = owner
     107        machine.contact = contact
    108108        machine.uuid = uuidToString(randomUUID())
    109109        machine.boot_off_cd = True
Note: See TracChangeset for help on using the changeset viewer.