simplify answers handling

This commit is contained in:
Michael Hudson-Doyle 2018-05-10 16:23:36 +12:00
parent 80fffc723c
commit 606573fa86
2 changed files with 1 additions and 2 deletions

View File

@ -18,7 +18,6 @@ Identity:
# ubuntu
password: '$6$wdAcoXrU039hKYPd$508Qvbe7ObUnxoj15DRCkzC3qO7edjH0VV7BPNRDYK4QR8ofJaEEF2heacn0QgD.f8pO8SNp83XNdWG6tocBM1'
ssh_import_id: lp:mwhudson
accept-ssh-key: true
InstallProgress:
reboot: yes

View File

@ -89,7 +89,7 @@ class IdentityController(BaseController):
ok, rest = result[0], result[1:]
if ok:
result, key_material, fingerprints = rest
if self.answers.get('accept-ssh-key'):
if 'ssh_import_id' in self.answers:
result['ssh_keys'] = key_material.splitlines()
self.loop.set_alarm_in(0.0, lambda loop, ud: self.done(result))
else: