예제 #1
0
파일: ssh.py 프로젝트: vish74/subiquity
 def default(self):
     self.ui.set_body(SSHView(self.model, self))
     if self.answers:
         d = {
             "install_server": self.answers.get("install_server", False),
             "authorized_keys": self.answers.get("authorized_keys", []),
             "pwauth": self.answers.get("pwauth", True),
         }
         self.done(d)
     elif 'ssh-import-id' in self.all_answers.get('Identity', {}):
         import_id = self.all_answers['Identity']['ssh-import-id']
         d = {
             "install_server": True,
             "pwauth": True,
         }
         self.fetch_ssh_keys(d, import_id)
예제 #2
0
 def start_ui(self):
     self.ui.set_body(SSHView(self.model, self))
     if self.answers:
         d = {
             "install_server": self.answers.get("install_server", False),
             "authorized_keys": self.answers.get("authorized_keys", []),
             "pwauth": self.answers.get("pwauth", True),
         }
         self.done(d)
     elif 'ssh-import-id' in self.app.answers.get('Identity', {}):
         import_id = self.app.answers['Identity']['ssh-import-id']
         d = {
             "ssh_import_id": import_id.split(":", 1)[0],
             "import_username": import_id.split(":", 1)[1],
             "install_server": True,
             "pwauth": True,
         }
         self.fetch_ssh_keys(d)
예제 #3
0
 async def make_ui(self):
     ssh_data = await self.endpoint.GET()
     return SSHView(self, ssh_data)
예제 #4
0
 def make_ui(self):
     ssh_data = SSHData(install_server=self.model.install_server,
                        allow_pw=self.model.pwauth)
     return SSHView(self, ssh_data)