Return a list of local variables for modify.tmpl.
"""
olddisk = {}
- transaction = ctx.current.create_transaction()
+ session.begin()
try:
kws = dict([(kw, fields.getfirst(kw)) for kw in 'machine_id owner admin contact name description memory vmtype disksize'.split()])
validate = validation.Validate(username, state, **kws)
if disk.size != disksize:
olddisk[disk.guest_device_name] = disksize
disk.size = disksize
- ctx.current.save(disk)
+ session.save_or_update(disk)
update_acl = False
if hasattr(validate, 'owner') and validate.owner != machine.owner:
if hasattr(validate, 'contact'):
machine.contact = validate.contact
- ctx.current.save(machine)
+ session.save_or_update(machine)
if update_acl:
print >> sys.stderr, machine, machine.administrator
cache_acls.refreshMachine(machine)
- transaction.commit()
+ session.commit()
except:
- transaction.rollback()
+ session.rollback()
raise
for diskname in olddisk:
controls.resizeDisk(oldname, diskname, str(olddisk[diskname]))
d = dict(op=op, user=username, fields=fields,
errorMessage=str(err), stderr=emsg, traceback=traceback)
details = templates.error_raw(searchList=[d])
- if username not in config.web.errormail_exclude:
+ if False: #username not in config.web.errormail_exclude:
send_error_mail('xvm error on %s for %s: %s' % (op, username, err),
details)
d['details'] = details