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 create destroy shutdown delete".split(" "):
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 create destroy shutdown delete".split(" "):