Changeset 2433 for package_branches/invirt-web/cherrypy/code/main.py
- Timestamp:
- Aug 11, 2009, 12:54:09 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
package_branches/invirt-web/cherrypy/code/main.py
r2432 r2433 296 296 hostname=cherrypy.request.local.name) 297 297 return d 298 299 @cherrypy.expose 300 def at(self, machine_id, k=None, c=0): 301 machine = validation.Validate(cherrypy.request.login, cherrypy.request.state, machine_id=machine_id).machine 302 if machine_id in self.atsessions: 303 term = self.atsessions[machine_id] 304 else: 305 print >>sys.stderr, "spawning new session for terminal to ",machine_id 306 term = self.atsessions[machine_id] = self.atmulti.create( 307 ["ssh", "-e","none", "-l", machine.name, config.console.hostname] 308 ) 309 if k: 310 self.atmulti.proc_write(term,k) 311 time.sleep(0.002) 312 dump=self.atmulti.dump(term,c) 313 cherrypy.response.headers['Content-Type']='text/xml' 314 if isinstance(dump,str): 315 return dump 316 else: 317 del self.atmulti[machine_id] 318 return '<?xml version="1.0"?><idem></idem>' 298 319 299 320 machine = MachineView()
Note: See TracChangeset
for help on using the changeset viewer.