From 43488ab51fe3490b7db7d7765f4ada95077239d8 Mon Sep 17 00:00:00 2001 From: Greg Price Date: Thu, 29 Oct 2009 01:36:35 -0400 Subject: [PATCH] small style fix svn path=/package_branches/invirt-web/cherrypy-rebased/; revision=2701 --- code/controls.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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(" "): -- 1.7.9.5