"%02x" * 6]) % tuple(u)
# end stolen code
-def kinit(username = 'tabbott/extra', keytab = '/etc/tabbott.keytab'):
+def kinit(username = 'daemon/sipb-xen.mit.edu', keytab = '/etc/sipb-xen.keytab'):
"""Kinit with a given username and keytab"""
p = subprocess.Popen(['kinit', "-k", "-t", keytab, username],
"""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]
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)