Exemple #1
0
 def on_shell_open(self, data):
     if self.ssh_info:
         self.close()
     self.ssh_info = {
         'cloud_id': data['cloud_id'],
         'machine_id': data['machine_id'],
         'host': data['host'],
         'columns': data['cols'],
         'rows': data['rows'],
         'ip': self.ip,
         'user_agent': self.user_agent,
         'email': self.user.email,
         'provider': data.get('provider', '')
     }
     self.hub_client = ShellHubClient(worker_kwargs=self.ssh_info)
     self.hub_client.on_data = self.emit_shell_data
     self.hub_client.start()
     log.info('on_shell_open finished')