machine = validation.Validate(username, state, machine_id=fields.getfirst('machine_id')).machine
action = fields.getfirst('action')
cdrom = fields.getfirst('cdrom')
- if cdrom is not None and not CDROM.get(cdrom):
+ if cdrom is not None and not CDROM.query().filter_by(cdrom_id=cdrom).one():
raise CodeError("Invalid cdrom type '%s'" % cdrom)
if action not in ('Reboot', 'Power on', 'Power off', 'Shutdown',
'Delete VM'):