command: recognize new "internal" name for delete
authorGreg Price <price@mit.edu>
Sun, 20 Dec 2009 03:30:08 +0000 (22:30 -0500)
committerGreg Price <price@mit.edu>
Sun, 20 Dec 2009 03:30:08 +0000 (22:30 -0500)
This fixes the bug where delete leads back to the now-broken info page.

svn path=/package_branches/invirt-web/cherrypy-rebased/; revision=2726

code/main.py

index 7c04d25..3be15a6 100755 (executable)
@@ -353,12 +353,12 @@ console will suffer artifacts.
         def command(self, command_name, machine_id, **kwargs):
             """Handler for running commands like boot and delete on a VM."""
             back = kwargs.get('back')
         def command(self, command_name, machine_id, **kwargs):
             """Handler for running commands like boot and delete on a VM."""
             back = kwargs.get('back')
+            if command_name == 'delete':
+                back = 'list'
             try:
                 d = controls.commandResult(cherrypy.request.login,
                                            cherrypy.request.state,
                                            command_name, machine_id, kwargs)
             try:
                 d = controls.commandResult(cherrypy.request.login,
                                            cherrypy.request.state,
                                            command_name, machine_id, kwargs)
-                if d['command'] == 'Delete VM':
-                    back = 'list'
             except InvalidInput, err:
                 if not back:
                     raise
             except InvalidInput, err:
                 if not back:
                     raise