From: Greg Price Date: Thu, 29 Oct 2009 05:36:35 +0000 (-0400) Subject: small style fix X-Git-Tag: 0.1.0^2~34 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/commitdiff_plain/43488ab51fe3490b7db7d7765f4ada95077239d8 small style fix svn path=/package_branches/invirt-web/cherrypy-rebased/; revision=2701 --- 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(" "):