X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/blobdiff_plain/36c143099b46d2bf77569d4f1d660505ed9d37d6..6a1f2bd00f0f8dbb52b25dd8a8e7c9cb8e2baccc:/code/main.py diff --git a/code/main.py b/code/main.py index c4eff65..74365f5 100755 --- a/code/main.py +++ b/code/main.py @@ -254,8 +254,7 @@ console will suffer artifacts. def __getattr__(self, name): try: - machine_id = int(name) - cherrypy.request.params['machine_id'] = machine_id + cherrypy.request.params['machine_id'] = int(name) return self except ValueError: return None @@ -341,12 +340,13 @@ console will suffer artifacts. port=port, authtoken=token) return d + @cherrypy.expose @cherrypy.tools.mako(filename="/command.mako") @cherrypy.tools.require_POST() def command(self, command_name, machine_id, **kwargs): """Handler for running commands like boot and delete on a VM.""" - back = kwargs.get('back', None) + back = kwargs.get('back') try: d = controls.commandResult(cherrypy.request.login, cherrypy.request.state,