X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/blobdiff_plain/812770288a8001b9c4c3e42f24be7cbb754202d6..69d11ccb77e5d5583fa1aee318a6afaa77000826:/code/main.py?ds=inline diff --git a/code/main.py b/code/main.py index f42e1fd..1f9189f 100755 --- a/code/main.py +++ b/code/main.py @@ -411,6 +411,7 @@ console will suffer artifacts. return d @cherrypy.expose + @cherrypy.tools.require_POST() @cherrypy.tools.gzip() def at(self, machine_id, k=None, c=0, force=0): machine = validation.Validate(cherrypy.request.login, cherrypy.request.state, machine_id=machine_id).machine @@ -419,9 +420,14 @@ console will suffer artifacts. term = self.atsessions[machine_id] else: print >>sys.stderr, "spawning new session for terminal to ",machine_id - term = self.atsessions[machine_id] = self.atmulti.create( + term = self.atmulti.create( ["ssh", "-e","none", "-l", machine.name, config.console.hostname] ) + # Clear out old sessions when fd is reused + for key in self.atsessions: + if self.atsessions[key] == term: + del self.atsessions[key] + self.atsessions[machine_id] = term if k: self.atmulti.proc_write(term,k) time.sleep(0.002)