small style fix
authorGreg Price <price@mit.edu>
Thu, 29 Oct 2009 05:36:35 +0000 (01:36 -0400)
committerGreg Price <price@mit.edu>
Thu, 29 Oct 2009 05:36:35 +0000 (01:36 -0400)
svn path=/package_branches/invirt-web/cherrypy-rebased/; revision=2701

code/controls.py

index c51a6ba..bbc9f8c 100644 (file)
@@ -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(" "):