Added nc
[invirt/packages/invirt-web.git] / code / controls.py
index a5f1693..0acca3a 100644 (file)
@@ -94,7 +94,7 @@ def bootMachine(machine, cdtype):
         raise CodeError('"%s" on "control %s create %s' 
                         % (err, machine.name, cdtype))
 
-def createVm(username, state, owner, contact, name, description, memory, disksize, machine_type, cdrom, autoinstall):
+def createVm(username, state, owner, contact, name, description, memory, disksize, machine_type, nic_type, cdrom, autoinstall):
     """Create a VM and put it in the database"""
     # put stuff in the table
     session.begin()
@@ -119,6 +119,7 @@ def createVm(username, state, owner, contact, name, description, memory, disksiz
                             "Contact %s." % config.contact)
         nic.machine = machine
         nic.hostname = name
+        nic.nic_type = nic_type
         session.add(nic)
         session.add(disk)
         cache_acls.refreshMachine(machine)