X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/blobdiff_plain/e73cda9748a8726531dba4b309783dde1597549a..1e922a353a14f5f231040595a93af3054ea41664:/code/controls.py diff --git a/code/controls.py b/code/controls.py index c51a6ba..bbc9f8c 100644 --- a/code/controls.py +++ b/code/controls.py @@ -208,9 +208,7 @@ def commandResult(username, state, command_name, machine_id, fields): start_time = 0 machine = validation.Validate(username, state, machine_id=machine_id).machine action = command_name - cdrom = fields.get('cdrom') - if not cdrom: - cdrom = None + cdrom = fields.get('cdrom') or None 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(" "):